62% contact-switcheroo

Code Review | Contact Switcheroo

WordPress plugin Contact Switcheroo scored62%from 54 tests.

About plugin

  • Plugin page: contact-switcheroo
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Nov 5, 2015
  • Latest release: Dec 15, 2016
  • Number of updates: 18
  • Update frequency: every 22.6 days
  • Top authors: hirenwadhiya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /643 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.93MB] [CPU: ▼15.92ms] Passed 4 tests

An overview of server-side resources used by Contact Switcheroo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.76 ▼1.32
Dashboard /wp-admin3.01 ▼0.2943.44 ▼10.74
Posts /wp-admin/edit.php3.01 ▼0.3442.17 ▲0.09
Add New Post /wp-admin/post-new.php3.01 ▼2.8739.42 ▼51.70
Media Library /wp-admin/upload.php3.01 ▼0.2143.02 ▲8.74
Contact Switcheroo /wp-admin/options-general.php?page=change_con_num_plugin3.0243.07

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: 1 new table, 7 new options
New tables
wp_con_num
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
CHANGE_CON_NUM_VERSION_KEY
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Contact Switcheroo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.38 ▲0.031.93 ▲0.2941.79 ▼0.47
Dashboard /wp-admin2,205 ▲255.48 ▼0.2285.13 ▼1.6342.74 ▲6.08
Posts /wp-admin/edit.php2,113 ▲161.97 ▼0.0036.33 ▼0.5839.80 ▲8.33
Add New Post /wp-admin/post-new.php1,387 ▼13920.69 ▼3.01520.14 ▼110.3363.30 ▲2.95
Media Library /wp-admin/upload.php1,413 ▲164.29 ▲0.12101.84 ▼2.7143.50 ▼3.07
Contact Switcheroo /wp-admin/options-general.php?page=change_con_num_plugin1,4122.1225.9132.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/contact-switcheroo/contact-switcheroo.php+76
    Undefined index: number1
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • CHANGE_CON_NUM_VERSION_KEY
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=change_con_num_plugin
    • > Notice in wp-content/plugins/contact-switcheroo/contact-switcheroo.php+76
    Undefined index: number1
    • > GET request to /wp-admin/options-general.php?page=change_con_num_plugin
    • > Notice in wp-content/plugins/contact-switcheroo/contact-switcheroo.php+77
    Undefined index: number2
    • > GET request to /wp-admin/options-general.php?page=change_con_num_plugin
    • > Notice in wp-content/plugins/contact-switcheroo/contact-switcheroo.php+101
    date_default_timezone_set(): Timezone ID '' is invalid

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/contact-switcheroo/timezone.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/contact-switcheroo/contact-switcheroo.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-switcheroo/contact-switcheroo.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === contact-switcheroo === )
Please take inspiration from this readme.txt

contact-switcheroo/contact-switcheroo.php Passed 13 tests

Analyzing the main PHP file in "Contact Switcheroo" version 1.0
123 characters long description:
This plugin will allow you to change the contact number frequently. For a specific time duration contact number is changed.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected218 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33014218

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin