62% wf-popup-menu

Code Review | WF Popup Menu

WordPress plugin WF Popup Menu scored62%from 54 tests.

About plugin

  • Plugin page: wf-popup-menu
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Nov 10, 2014
  • Latest release: Nov 10, 2014
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: Studentbd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,220 total downloads

Benchmarks

Plugin footprint 65% 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.87MB] [CPU: ▼37.51ms] Passed 4 tests

An overview of server-side resources used by WF Popup Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.09 ▼0.3716.56 ▼26.28
Dashboard /wp-admin3.14 ▼0.1618.17 ▼30.33
Posts /wp-admin/edit.php3.14 ▼0.2119.84 ▼24.91
Add New Post /wp-admin/post-new.php3.14 ▼2.7419.85 ▼68.53
Media Library /wp-admin/upload.php3.14 ▼0.0922.10 ▼13.40
Popup Menu /wp-admin/edit.php?post_type=popup_menu3.1421.07
Add Popup Menu /wp-admin/post-new.php?post_type=popup_menu3.1416.58

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WF Popup Menu
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,058 ▲32315.11 ▲0.364.74 ▲2.8841.05 ▼8.08
Dashboard /wp-admin2,374 ▲1836.44 ▲0.57123.33 ▲15.6943.54 ▲1.52
Posts /wp-admin/edit.php2,280 ▲1913.35 ▲1.3656.35 ▲19.7937.16 ▲1.48
Add New Post /wp-admin/post-new.php1,737 ▲20323.05 ▼0.18606.70 ▼71.8632.98 ▼19.33
Media Library /wp-admin/upload.php1,419 ▲284.23 ▲0.0579.40 ▼17.1640.33 ▼4.63
Popup Menu /wp-admin/edit.php?post_type=popup_menu1,2643.4145.5127.03
Add Popup Menu /wp-admin/post-new.php?post_type=popup_menu1,8274.0078.4261.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/wf-popup-menu/lib/init.php+746
    count(): Parameter must be an array or an object that implements Countable
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=popup_menu
    • > Warning in wp-content/plugins/wf-popup-menu/lib/init.php+746
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wf-popup-menu/lib/tests/phpunit/includes/bootstrap.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wf-popup-menu/inc/custom_meta_box.php:63
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wf-popup-menu/lib/tests/phpunit/tests/CMB_Core_Test.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wf-popup-menu/lib/init.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wf-popup-menu/lib/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wf-popup-menu/index.php:15

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 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
  • Screenshots: Please add images for these screenshots: #1 (Find Shortcode in Dashboard > Popup Menu.), #2 (Menu link in Page), #3 (Demo of Menu .Live link here http://demo.hamidulbd.com/wf-popup-menu-demo/.)
The official readme.txt is a good inspiration

wf-popup-menu/index.php 92% from 13 tests

The main file in "WF Popup Menu" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("wf-popup-menu.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected5,709 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63314152,316
PHP115461,0862,182
CSS310121814
Markdown3830272
Bourne Shell115459
JSON10031
YAML15018
XML10117

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity57.14
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods134
▷ Static methods3425.37%
▷ Public methods13298.51%
▷ Protected methods21.49%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
lib/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
lib/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
lib/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%