10% domain-name-autoswitch

Code Review | Domain Name Autoswitch

WordPress plugin Domain Name Autoswitch scored10%from 54 tests.

About plugin

  • Plugin page: domain-name-autos...
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 25, 2014
  • Latest release: Jun 14, 2014
  • Number of updates: 12
  • Update frequency: every 9.0 days
  • Top authors: bmenant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,254 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/domain-name-autoswitch/domain-name-autoswitch-wp.php+96
    include_once(wp-content/plugins/domain-name-autoswitch/domain-name-autoswitch-config.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼0.01MB] [CPU: ▼8.33ms] Passed 4 tests

A check of server-side resources used by Domain Name Autoswitch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.42 ▼4.49
Dashboard /wp-admin3.31 ▼0.0446.86 ▼13.34
Posts /wp-admin/edit.php3.36 ▲0.0046.60 ▼2.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.28 ▼13.16
Media Library /wp-admin/upload.php3.23 ▲0.0035.41 ▲4.44

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Domain Name Autoswitch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▼0.081.77 ▼0.0343.83 ▲0.43
Dashboard /wp-admin2,206 ▲245.84 ▼0.05103.24 ▼15.9937.05 ▼4.59
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0236.01 ▲0.2532.49 ▼2.46
Add New Post /wp-admin/post-new.php1,533 ▲1423.19 ▲0.08677.32 ▲55.4554.55 ▲2.23
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0496.83 ▼1.3643.12 ▼3.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/domain-name-autoswitch/domain-name-autoswitch-wp.php:93

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
The official readme.txt might help

domain-name-autoswitch/domain-name-autoswitch-wp.php 92% from 13 tests

The entry point to "Domain Name Autoswitch" version 1.2.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("domain-name-autoswitch.php" instead of "domain-name-autoswitch-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected216 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP234139216

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods866.67%
▷ Protected methods00.00%
▷ Private methods433.33%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin