10% wp-responsive-demo-switch-bar

Code Review | WP Responsive Demo Switch Bar

WordPress plugin WP Responsive Demo Switch Bar scored10%from 54 tests.

About plugin

  • Plugin page: wp-responsive-dem...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2016
  • Latest release: Sep 29, 2016
  • Number of updates: 27
  • Update frequency: every 4.3 days
  • Top authors: themeidol (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /2,179 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-responsive-demo-switch-bar/wp-demobar.php+140
    Undefined property: WP_Responsive_Demo_Switch_Bar::$version

Server metrics [RAM: ▼1.66MB] [CPU: ▼54.41ms] Passed 4 tests

An overview of server-side resources used by WP Responsive Demo Switch Bar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.33 ▼1.135.96 ▼36.21
Dashboard /wp-admin2.35 ▼0.997.83 ▼57.12
Posts /wp-admin/edit.php2.35 ▼1.008.19 ▼36.31
Add New Post /wp-admin/post-new.php2.35 ▼3.536.80 ▼88.01
Media Library /wp-admin/upload.php2.35 ▼0.887.25 ▼31.36
Demobar Settings /wp-admin/options-general.php?page=wpdemobar_settings2.357.44
Sites /wp-admin/edit.php?post_type=demosites2.359.36
Add Site /wp-admin/post-new.php?post_type=demosites2.357.43

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP Responsive Demo Switch Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲8013.75 ▼0.441.74 ▼0.3644.07 ▼1.01
Dashboard /wp-admin2,254 ▲635.05 ▲0.11102.36 ▼1.4542.45 ▲0.51
Posts /wp-admin/edit.php2,139 ▲502.28 ▲0.1340.87 ▲6.9234.61 ▼1.87
Add New Post /wp-admin/post-new.php1,561 ▲4218.75 ▼4.55604.12 ▼96.1936.03 ▼16.27
Media Library /wp-admin/upload.php1,430 ▲424.41 ▲0.2095.75 ▼9.9840.31 ▼3.24
Demobar Settings /wp-admin/options-general.php?page=wpdemobar_settings1,3163.9663.9733.11
Sites /wp-admin/edit.php?post_type=demosites1,0992.2532.0129.37
Add Site /wp-admin/post-new.php?post_type=demosites1,8644.1676.8332.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-responsive-demo-switch-bar/wp-demobar.php+140
    Undefined property: WP_Responsive_Demo_Switch_Bar::$version
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=demosites
    • > Notice in wp-content/plugins/wp-responsive-demo-switch-bar/wp-demobar.php+140
    Undefined property: WP_Responsive_Demo_Switch_Bar::$version
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=demosites
    • > 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 Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: theme demo switcher, responsive bar, theme demo bar, responsive test tool, wordpress theme switcher...

wp-responsive-demo-switch-bar/wp-demobar.php 77% from 13 tests

The entry point to "WP Responsive Demo Switch Bar" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0" instead of "4.4")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-responsive-demo-switch-bar.php" instead of "wp-demobar.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin4,444 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS387162,836
PHP3173262808
SVG100640
JavaScript22717160

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity40.00
▷ Minimum class complexity2.00
▷ Maximum class complexity78.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods412.50%
▷ Public methods3093.75%
▷ Protected methods00.00%
▷ Private methods26.25%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/bg.png20.87KB22.10KB0.00%