83% jc-submenu

Code Review | JC Submenu

WordPress plugin JC Submenu scored83%from 54 tests.

About plugin

  • Plugin page: jc-submenu
  • Plugin version: 0.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Jul 18, 2013
  • Latest release: Aug 17, 2020
  • Number of updates: 112
  • Update frequency: every 23.1 days
  • Top authors: jcollings (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

6,000+ active /56,091 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼0.04ms] Passed 4 tests

An overview of server-side resources used by JC Submenu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3342.78 ▲4.70
Dashboard /wp-admin3.63 ▲0.3350.29 ▲2.37
Posts /wp-admin/edit.php3.74 ▲0.3946.24 ▲0.19
Add New Post /wp-admin/post-new.php6.23 ▲0.3482.87 ▼7.22
Media Library /wp-admin/upload.php3.55 ▲0.3236.15 ▲4.51
JC Submenu /wp-admin/options-general.php?page=jc-submenu3.5233.10

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_jc_section_menu_widget
widget_recent-comments
db_upgraded
widget_jc_split_menu_widget

Browser metrics Passed 4 tests

An overview of browser requirements for JC Submenu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6714.79 ▲0.411.70 ▲0.0043.38 ▼0.06
Dashboard /wp-admin2,222 ▲315.10 ▲0.21101.12 ▼3.2541.49 ▼2.81
Posts /wp-admin/edit.php2,099 ▲72.06 ▲0.0338.65 ▼3.8933.83 ▼3.84
Add New Post /wp-admin/post-new.php1,527 ▲823.16 ▲0.11662.43 ▲59.5757.07 ▲3.57
Media Library /wp-admin/upload.php1,404 ▲194.28 ▲0.0698.25 ▼2.8940.34 ▼1.02
JC Submenu /wp-admin/options-general.php?page=jc-submenu7942.0625.0625.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_jc_section_menu_widget
    • db_upgraded
    • widget_recent-comments
    • widget_jc_split_menu_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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 take a closer look at the following
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/jc-submenu/walkers/AdminMenuWalker.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/jc-submenu/widgets/SplitMenuWidget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jc-submenu/submenu.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/jc-submenu/widgets/SectionMenuWidget.php:10
    • > PHP Notice
      Undefined variable: item_id in wp-content/plugins/jc-submenu/views/edit.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/jc-submenu/walkers/SubmenuWalker.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JC_Submenu_Nav_Walker' not found in wp-content/plugins/jc-submenu/walkers/DropdownWalker.php:2
    • > PHP Notice
      Undefined variable: item_id in wp-content/plugins/jc-submenu/views/edit.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/jc-submenu/views/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SubmenuModel' not found in wp-content/plugins/jc-submenu/views/edit.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: Add images for these screenshots: #1 (JC Submenu, Post population options), #2 (JC Submenu, Taxonomy population options), #3 (JC Submenu, Page children population options), #4 (JC Submenu, Advanced Submenu Widget Options)
The official readme.txt is a good inspiration

jc-submenu/submenu.php 85% from 13 tests

The main PHP file in "JC Submenu" ver. 0.9.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 188 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("jc-submenu.php" instead of "submenu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin2,136 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP105035121,811
JavaScript211289258
CSS110267

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity41.75
▷ Minimum class complexity2.00
▷ Maximum class complexity189.00
Average method complexity5.87
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods67
▷ Static methods811.94%
▷ Public methods67100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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
4 PNG files occupy 0.15MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png50.07KB14.33KB▼ 71.39%
screenshot-2.png43.68KB13.68KB▼ 68.68%
screenshot-3.png36.55KB11.35KB▼ 68.94%
screenshot-4.png26.84KB8.63KB▼ 67.85%