78% jin-menu

Code Review | JinMenu

WordPress plugin JinMenu scored78%from 54 tests.

About plugin

  • Plugin page: jin-menu
  • Plugin version: 3.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2012
  • Latest release: May 19, 2020
  • Number of updates: 52
  • Update frequency: every 54.5 days
  • Top authors: aniketan (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

400+ active /12,368 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.25ms] Passed 4 tests

An overview of server-side resources used by JinMenu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0244.81 ▲0.92
Dashboard /wp-admin3.33 ▲0.0348.26 ▼2.37
Posts /wp-admin/edit.php3.39 ▲0.0347.30 ▼0.94
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.76 ▼6.60
Media Library /wp-admin/upload.php3.26 ▲0.0340.92 ▲3.10
Jin Menus /wp-admin/themes.php?page=jin-plugin-menu3.2432.83

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for JinMenu
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲14013.95 ▼0.288.41 ▲6.2139.09 ▼2.80
Dashboard /wp-admin2,207 ▲194.84 ▼0.08102.14 ▼6.4540.64 ▼1.19
Posts /wp-admin/edit.php2,096 ▲42.04 ▼0.0035.04 ▼8.9031.75 ▼7.15
Add New Post /wp-admin/post-new.php1,545 ▲2618.56 ▼4.58652.67 ▼0.7955.00 ▼1.98
Media Library /wp-admin/upload.php1,389 ▲44.17 ▼0.0299.17 ▼5.4340.61 ▼3.19
Jin Menus /wp-admin/themes.php?page=jin-plugin-menu1,0523.6977.6232.89

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=jin-plugin-menu
    • > Notice in wp-content/plugins/jin-menu/template.php+6
    Undefined offset: 0
    • > GET request to /wp-admin/themes.php?page=jin-plugin-menu
    • > Notice in wp-content/plugins/jin-menu/template.php+5
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/themes.php?page=jin-plugin-menu
    • > Notice in wp-content/plugins/jin-menu/template.php+6
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/themes.php?page=jin-plugin-menu
    • > Notice in wp-content/plugins/jin-menu/template.php+157
    Trying to get property 'type' of non-object

SRP 50% from 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
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jin-menu/jinmenu.php:199
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/jin-menu/template.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: onclick event, jquery, wp menu, jquery code in menu, onclick in wp menu...

jin-menu/jinmenu.php 92% from 13 tests

This is the main PHP file of "JinMenu" version 3.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("jin-menu.php" instead of "jinmenu.php")

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
No dangerous file extensions were detected259 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP223815259

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png30.89KB11.47KB▼ 62.87%