78% custom-post-type-auto-menu

Code Review | Custom Post Type Auto Menu

WordPress plugin Custom Post Type Auto Menu scored78%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Sep 7, 2013
  • Latest release: Jun 21, 2021
  • Number of updates: 40
  • Update frequency: every 71.2 days
  • Top authors: badfun (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /21,162 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.93ms] Passed 4 tests

A check of server-side resources used by Custom Post Type Auto Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1441.20 ▼0.54
Dashboard /wp-admin3.45 ▲0.1147.31 ▼14.80
Posts /wp-admin/edit.php3.57 ▲0.2150.91 ▲1.08
Add New Post /wp-admin/post-new.php6.03 ▲0.1590.21 ▼6.59
Media Library /wp-admin/upload.php3.38 ▲0.1535.69 ▼1.80

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
cpt_auto_menu_cpt_list
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
cpt_auto_menu_settings
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Post Type Auto Menu
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.17 ▼0.231.71 ▼0.0037.83 ▼3.54
Dashboard /wp-admin2,211 ▲375.64 ▲0.0095.86 ▼0.6637.78 ▼1.43
Posts /wp-admin/edit.php2,116 ▲161.99 ▲0.0141.66 ▲5.2236.81 ▲3.01
Add New Post /wp-admin/post-new.php1,539 ▲423.20 ▲4.97682.03 ▲75.0560.64 ▼8.58
Media Library /wp-admin/upload.php1,413 ▲134.18 ▼0.0197.28 ▼3.9542.39 ▼1.76

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/custom-post-type-auto-menu/includes/Plugin.php
    • > /wp-content/plugins/custom-post-type-auto-menu/includes/Menu_Handler.php
    • > /wp-content/plugins/custom-post-type-auto-menu/includes/Settings_Page.php
    • > /wp-content/plugins/custom-post-type-auto-menu/bfp-cpt-auto-menu.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/custom-post-type-auto-menu/views/settings.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: custom post type, menus, auto menu

custom-post-type-auto-menu/bfp-cpt-auto-menu.php 85% from 13 tests

Analyzing the main PHP file in "Custom Post Type Auto Menu" version 1.3.1
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-post-type-auto-menu.php" instead of "bfp-cpt-auto-menu.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,155 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP9253587637
PO File5120120379
Markdown139091
CSS17229
JavaScript1101919

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity27.67
▷ Minimum class complexity7.00
▷ Maximum class complexity48.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods4177.36%
▷ Protected methods11.89%
▷ Private methods1120.75%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected