83% tp-navigation-menu

Code Review | T&P Navigation Menu

WordPress plugin T&P Navigation Menu scored 83% from 54 tests.

About plugin

  • Plugin page: tp-navigation-menu
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.6
  • WordPress version: 6.3.1
  • First release: Aug 23, 2013
  • Latest release: Aug 23, 2013
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: pey22 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 4,356 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.45ms] Passed 4 tests

This is a short check of server-side resources used by T&P Navigation Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.41 ▼3.77
Dashboard /wp-admin3.32 ▲0.0253.29 ▲9.27
Posts /wp-admin/edit.php3.37 ▲0.0149.62 ▲0.44
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.25 ▼8.42
Media Library /wp-admin/upload.php3.24 ▲0.0136.14 ▲1.96

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for T&P Navigation Menu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15213.67 ▼0.629.06 ▲7.1544.38 ▼3.02
Dashboard /wp-admin2,206 ▲184.82 ▼1.04112.15 ▼2.4742.86 ▲3.11
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0435.42 ▼6.3132.62 ▼5.06
Add New Post /wp-admin/post-new.php1,536 ▼023.21 ▲0.01670.44 ▲56.8464.69 ▲12.00
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.07105.19 ▼3.5848.65 ▲4.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/tp-navigation-menu/index.php:41

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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: These screenshots do not have images: #1 (screenshot-1.jpg), #2 (screenshot-2.jpg), #3 (screenshot-3.jpg)
You can look at the official readme.txt

tp-navigation-menu/index.php 85% from 13 tests

Analyzing the main PHP file in "T&P Navigation Menu" version 0.1
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 213 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tp-navigation-menu.php" instead of "index.php")

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 plugin68 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1256145
JavaScript16519
CSS1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods571.43%
▷ Protected methods00.00%
▷ Private methods228.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/brown-2.png0.11KB0.09KB▼ 12.84%
css/pink.png0.11KB0.09KB▼ 12.84%
css/brown.png0.11KB0.09KB▼ 13.64%