94% location-specific-menu-items-by-country

Code Review | Country Specific Menu Items

WordPress plugin Country Specific Menu Items scored 94% from 54 tests.

About plugin

  • Plugin page: location-specific...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 5.8.1
  • First release: Mar 6, 2016
  • Latest release: May 6, 2017
  • Number of updates: 51
  • Update frequency: every 9.3 days
  • Top authors: Ryan Stutzman (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active / 4,025 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼138.41ms] Passed 4 tests

An overview of server-side resources used by Country Specific Menu Items
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1735.96 ▲13.77
Dashboard /wp-admin3.13 ▲0.0743.78 ▼1.61
Posts /wp-admin/edit.php3.21 ▲0.1045.04 ▲1.39
Add New Post /wp-admin/post-new.php5.48 ▲0.0587.73 ▼560.32
Media Library /wp-admin/upload.php3.07 ▲0.0634.51 ▲6.92

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Country Specific Menu Items
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,742 ▲14616.28 ▲0.629.35 ▼0.0249.87 ▼1.68
Dashboard /wp-admin2,993 ▲565.96 ▲0.01136.26 ▼13.58120.61 ▲6.90
Posts /wp-admin/edit.php2,777 ▲412.74 ▲0.0263.24 ▼7.5998.70 ▲13.13
Add New Post /wp-admin/post-new.php1,645 ▼2721.40 ▲2.33267.28 ▼127.90107.50 ▼1.28
Media Library /wp-admin/upload.php1,788 ▼195.03 ▲0.01152.73 ▲10.43127.48 ▲8.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/location-specific-menu-items-by-country/includes/walker-nav-menu-edit.php
    • > /wp-content/plugins/location-specific-menu-items-by-country/CSMI.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: menu, navigation menu, nav-menu, navigation, country...

location-specific-menu-items-by-country/CSMI.php 92% from 13 tests

The entry point to "Country Specific Menu Items" version 1.0.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("location-specific-menu-items-by-country.php" instead of "CSMI.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
Good job! No executable or dangerous file extensions detected911 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of 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.37
Average class complexity18.00
▷ Minimum class complexity2.00
▷ Maximum class complexity34.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods18.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions5100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings