Skip to main content

Posts

Showing posts with the label upwork

WordPress Test Upwork Answers 2019

Which of the following is a default user role in wordPress? Answers Blogger Author Subscriber Contributor What are wordPress hooks? Answers Setting option available to WordPress administrators Security function that run inside WordPress Group of plugins which control WordPress behavior Ways to change the default behavior of WordPress Which constant is NOT recognized in wp-config.php? Answers WP_SITEURL WP_CONTENT_DIR WP_CONTENT_URL WP_HOME_URL Which of the following HTML tags are not allowed to be used in post comment? Answers Code form img strike table Which of the following is not a default image size in WP? Answers Small Size Medium Size Large Size Thumbnail Size What does WordPress use to control user access to different features? Answers Username Access Tokens Role Cookies Which WordPress system can be used to temporarily store information? Answers Options Meta Tables Transients The Rest API _____ is the ability for reader...

PHP Test Upwork Answers 2019

1. Which of the following will produce a value of “83” as its output? echo intval(“0123”, 8); echo (int) 083 echo (int) 123; echo intval(“0123”); Answer : echo intval(“0123”, 8); 2. What will be the output of the following code? class Person { protected $name; public function __construct($name) { $this->name = $name; } public function getName() { return $this->name; } } $person = new Person(“Foo”); echo $person->getName(); Nothing will be printed on-screen. Foo Syntax error on line $this->name=$name Fatal error on line $this->name=$name Answer : Foo 3. What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection. Use mysql_query() and variables: for example: $input = $_POST[‘user_input’]; mysql_query(“INSERT INTO table (column) VALUES (‘” . $input . “‘)”); Use PDO prepared statements and parameterized queries: for example: $input= $_POST[“user-input”] $stmt = $pdo->prep...