68% cp-demo-switcher

Code Review | Theme Demo Switcher and Page Switch Bar

WordPress plugin Theme Demo Switcher and Page Switch Bar scored68%from 54 tests.

About plugin

  • Plugin page: cp-demo-switcher
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 22, 2018
  • Latest release: Sep 22, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: CodePassenger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /697 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.81MB] [CPU: ▼34.63ms] Passed 4 tests

An overview of server-side resources used by Theme Demo Switcher and Page Switch Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1940.07 ▼0.65
Dashboard /wp-admin3.14 ▼0.2025.30 ▼37.43
Posts /wp-admin/edit.php3.15 ▼0.2126.28 ▼19.96
Add New Post /wp-admin/post-new.php3.15 ▼2.7424.31 ▼70.20
Media Library /wp-admin/upload.php3.15 ▼0.0823.42 ▼10.92
Add New Project /wp-admin/post-new.php?post_type=cds-project3.1525.70
All Project /wp-admin/edit.php?post_type=cds-project3.1523.51
Setting /wp-admin/edit.php?post_type=cds-project&page=cds_settings3.1526.02

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Theme Demo Switcher and Page Switch Bar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,101 ▲35515.80 ▲1.4310.10 ▲8.3647.34 ▲0.31
Dashboard /wp-admin2,375 ▲1846.47 ▲1.63123.27 ▲18.2040.98 ▼3.75
Posts /wp-admin/edit.php2,284 ▲1953.37 ▲1.3555.53 ▲17.3233.70 ▲0.35
Add New Post /wp-admin/post-new.php1,544 ▲3017.64 ▲0.16600.52 ▼93.4334.31 ▼20.94
Media Library /wp-admin/upload.php1,420 ▲294.22 ▲0.0483.56 ▼17.2444.24 ▼0.40
Add New Project /wp-admin/post-new.php?post_type=cds-project1,6893.6365.8436.03
All Project /wp-admin/edit.php?post_type=cds-project1,2543.3942.8125.68
Setting /wp-admin/edit.php?post_type=cds-project&page=cds_settings1,0473.3946.1023.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cds-project&page=cds_settings
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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 items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-demo-switcher/include/cds-project.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-demo-switcher/cp-demo-switcher.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/cp-demo-switcher/template/page-demo-switcher.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cp-demo-switcher/include/cds-settings-fields.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: demo bar, theme switch, demo switcher, responsive demo bar, page switch bar...

cp-demo-switcher/cp-demo-switcher.php Passed 13 tests

The entry point to "Theme Demo Switcher and Page Switch Bar" version 1.0 is a PHP file that has certain tags in its header comment area
52 characters long description:
Switch between Theme Demo and Pages for Theme Author

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,126 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP57992667
SVG100640
CSS65032635
JavaScript5185184

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.50
▷ Minimum class complexity2.00
▷ Maximum class complexity49.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin