10% menu-card

Code Review | Menu Card

WordPress plugin Menu Card scored10%from 54 tests.

About plugin

  • Plugin page: menu-card
  • Plugin version: 0.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Jul 9, 2015
  • Latest release: Apr 12, 2017
  • Number of updates: 10
  • Update frequency: every 64.3 days
  • Top authors: furqan Khanzada (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,998 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/menu-card/inc/class-menu-card.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼50.98ms] Passed 4 tests

Analyzing server-side resources used by Menu Card
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.40 ▼37.71
Dashboard /wp-admin2.10 ▼1.206.88 ▼41.07
Posts /wp-admin/edit.php2.10 ▼1.266.37 ▼39.03
Add New Post /wp-admin/post-new.php2.10 ▼3.795.71 ▼86.11
Media Library /wp-admin/upload.php2.10 ▼1.134.97 ▼31.30
All Menu Cards /wp-admin/edit.php?post_type=menu-cards2.105.76
Menu Card /wp-admin/options-general.php?page=menu-card-options2.107.05
Menu Card Categories /wp-admin/edit-tags.php?taxonomy=menu-card-category&post_type=menu-cards2.106.15
Add New /wp-admin/post-new.php?post_type=menu-cards2.106.44

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Menu Card
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲20713.69 ▼0.629.49 ▲7.7239.52 ▼3.15
Dashboard /wp-admin2,241 ▲524.84 ▼0.27109.98 ▼11.7142.69 ▲0.45
Posts /wp-admin/edit.php2,124 ▲352.17 ▲0.1340.27 ▲3.7735.90 ▼0.57
Add New Post /wp-admin/post-new.php1,576 ▲4318.64 ▼4.62594.19 ▼78.7956.51 ▲2.35
Media Library /wp-admin/upload.php1,423 ▲354.19 ▼0.0294.86 ▼20.3840.67 ▼8.66
All Menu Cards /wp-admin/edit.php?post_type=menu-cards1,0961.9329.9228.55
Menu Card /wp-admin/options-general.php?page=menu-card-options8271.7123.7025.58
Menu Card Categories /wp-admin/edit-tags.php?taxonomy=menu-card-category&post_type=menu-cards1,2942.1428.8228.52
Add New /wp-admin/post-new.php?post_type=menu-cards2,4307.69166.4562.97

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 had uncaught errors
    • > Deprecated in wp-content/plugins/menu-card/inc/class-menu-card.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu-cards
    • > Deprecated in wp-content/plugins/menu-card/inc/class-menu-card.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu-cards
    • > Deprecated in wp-content/plugins/menu-card/inc/custom-post-base.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card_Custom_Post_Base has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu-cards
    • > Deprecated in wp-content/plugins/menu-card/inc/custom-post-menu-cards.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card_MenuCards_Custom_Post has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu-cards
    • > Deprecated in wp-content/plugins/menu-card/inc/admin-settings.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card_Admin has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=menu-cards
    • > Deprecated in wp-content/plugins/menu-card/inc/admin-settings-base.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; Menu_Card_Admin_Base has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=menu-card-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=menu-card-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=menu-card-options
    • > Notice in wp-content/plugins/menu-card/inc/admin-settings-base.php+65
    Trying to access array offset on value of type bool

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/menu-card/views/public.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Menu_Card_Custom_Post_Base' not found in wp-content/plugins/menu-card/inc/custom-post-menu-cards.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/menu-card/views/admin.php:17

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-1.png) image missing
The official readme.txt is a good inspiration

menu-card/menu-card.php 92% from 13 tests

"Menu Card" version 0.8.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin1,170 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP10242477629
CSS41937243
JavaScript45754177
HTML112785
PO File22436

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity7.17
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods61
▷ Static methods813.11%
▷ Public methods3354.10%
▷ Protected methods1727.87%
▷ Private methods1118.03%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.38MB with 0.32MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png345.59KB116.20KB▼ 66.38%
(invalid) assets/banner-1544x500.png40.22KB0.00KB▼ 100.00%
assets/price-line.png0.91KB0.10KB▼ 89.35%