10% menuthroughjson

Code Review | MenuThroughJSON

WordPress plugin MenuThroughJSON scored 10% from 54 tests.

About plugin

  • Plugin page: menuthroughjson
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 19, 2018
  • Latest release: Aug 19, 2018
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: simone1040 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 492 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
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/menuthroughjson/MenuThroughJSON.php+19
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.71MB] [CPU: ▼55.89ms] Passed 4 tests

A check of server-side resources used by MenuThroughJSON
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.185.78 ▼36.42
Dashboard /wp-admin2.30 ▼1.016.47 ▼60.99
Posts /wp-admin/edit.php2.30 ▼1.067.57 ▼43.68
Add New Post /wp-admin/post-new.php2.30 ▼3.598.38 ▼82.48
Media Library /wp-admin/upload.php2.30 ▼0.936.29 ▼27.76
MenuThroughJSON /wp-admin/admin.php?page=MTJ_MenuThroughJSONDashboard2.307.12
Gestione Plugin /wp-admin/admin.php?page=MTJ_gestionePlugin2.3010.93
Gestione Speciali /wp-admin/admin.php?page=MTJ_gestioneSpeciali2.307.40

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

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

Browser metrics Passed 4 tests

Checking browser requirements for MenuThroughJSON
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲17314.22 ▼0.201.75 ▲0.1239.14 ▼12.55
Dashboard /wp-admin2,311 ▲1236.04 ▲1.16122.52 ▲7.3246.83 ▲3.27
Posts /wp-admin/edit.php2,183 ▲942.78 ▲0.7444.09 ▲0.6734.72 ▼0.35
Add New Post /wp-admin/post-new.php1,770 ▲25623.86 ▲6.22678.87 ▼0.9646.19 ▼2.17
Media Library /wp-admin/upload.php1,499 ▲1085.22 ▲1.01108.14 ▲13.5641.65 ▼1.22
MenuThroughJSON /wp-admin/admin.php?page=MTJ_MenuThroughJSONDashboard1,0392.9053.7839.43
Gestione Plugin /wp-admin/admin.php?page=MTJ_gestionePlugin1,4633.3061.0332.25
Gestione Speciali /wp-admin/admin.php?page=MTJ_gestioneSpeciali1,1442.7849.8133.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/menuthroughjson/MenuThroughJSON.php+19
    define(): Declaration of case-insensitive constants is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=MTJ_gestioneSpeciali
    • > Deprecated in wp-content/plugins/menuthroughjson/MenuThroughJSON.php+19
    define(): Declaration of case-insensitive constants is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=MTJ_MenuThroughJSONDashboard
    • > Notice in wp-content/plugins/menuthroughjson/dashboardmenu.php+22
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=MTJ_MenuThroughJSONDashboard
    • > Notice in wp-content/plugins/menuthroughjson/dashboardmenu.php+36
    Undefined variable: resultMenuVoice

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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/menuthroughjson/MenuThroughJSON.php:701
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/menuthroughjson/custom_class/MTJ_speciali.class.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/menuthroughjson/custom_class/MTJ_dashboard.class.php:52
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/menuthroughjson/custom_class/MTJ_gestionePlugin.class.php:13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/menuthroughjson/custom_class/MTJ_dashboard.class.php on line 51

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: menu, ios, json, android

menuthroughjson/MenuThroughJSON.php 85% from 13 tests

The main PHP script in "MenuThroughJSON" version 1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("menuthroughjson.php" instead of "MenuThroughJSON.php")
  • Description: The description should be shorter than 140 characters (currently 254 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/menuthroughjson/assets/bootstrap/nuget/MyGet.ps1
90,948 lines of code in 1,012 files:
LanguageFilesBlank linesComment linesLines of code
HTML22,239026,219
JavaScript1486,5169,43524,565
SVG7361173712,833
CSS161,3939112,005
LESS751,1801,5547,823
JSON14003,409
Sass4762,243
PHP793531,381
Markdown51330338
YAML2161672
XML20056
PowerShell1224

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.67
▷ Minimum class complexity2.00
▷ Maximum class complexity7.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions2596.15%
▷ Anonymous functions13.85%
Constants1
▷ Global constants1100.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
603 compressed PNG files occupy 1.82MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/Ionicons/png/512/ios7-football-outline.png6.12KB6.88KB0.00%
assets/Ionicons/png/512/social-yahoo.png1.69KB1.81KB0.00%
assets/Ionicons/png/512/ios7-copy.png0.76KB0.79KB0.00%
assets/Ionicons/png/512/social-linkedin.png2.22KB2.38KB0.00%
assets/Ionicons/png/512/speakerphone.png4.21KB4.63KB0.00%