10% genesis-stage-switcher

Code Review | Genesis Stage Switcher

WordPress plugin Genesis Stage Switcher scored10%from 54 tests.

About plugin

  • Plugin page: genesis-stage-swi...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2014
  • Latest release: Apr 3, 2014
  • Number of updates: 5
  • Update frequency: every 9.2 days
  • Top authors: james.w.lane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /750 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/genesis-stage-switcher/Genesis-Stage-Switcher.php+105
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.91MB] [CPU: ▼57.73ms] Passed 4 tests

An overview of server-side resources used by Genesis Stage Switcher
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.395.50 ▼40.46
Dashboard /wp-admin2.10 ▼1.216.66 ▼50.67
Posts /wp-admin/edit.php2.10 ▼1.266.53 ▼46.57
Add New Post /wp-admin/post-new.php2.10 ▼3.797.10 ▼93.22
Media Library /wp-admin/upload.php2.10 ▼1.137.15 ▼26.61

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Genesis Stage Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.23 ▼0.131.63 ▼0.2143.01 ▼2.03
Dashboard /wp-admin2,211 ▲345.54 ▼0.0284.43 ▼13.4339.73 ▼7.20
Posts /wp-admin/edit.php2,116 ▲161.98 ▼0.0236.52 ▲1.5132.46 ▼10.81
Add New Post /wp-admin/post-new.php1,539 ▲622.96 ▲0.20689.21 ▼23.0471.82 ▼0.94
Media Library /wp-admin/upload.php1,416 ▲224.19 ▼0.0297.57 ▼7.2341.22 ▼1.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/genesis-stage-switcher/Genesis-Stage-Switcher.php+105
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/genesis-stage-switcher/Genesis-Stage-Switcher.php:103

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: enviroment, genesis

genesis-stage-switcher/Genesis-Stage-Switcher.php 92% from 13 tests

The main file in "Genesis Stage Switcher" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("genesis-stage-switcher.php" instead of "Genesis-Stage-Switcher.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
Everything looks great! No dangerous files found in this plugin183 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP145109143
Markdown119040

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image.png14.04KB4.58KB▼ 67.40%