94% advanced-post-manager

Code Review | Advanced Post Manager

WordPress plugin Advanced Post Manager scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-post-man...
  • Plugin version: 4.5.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8.2
  • WordPress version: 5.9.2
  • First release: Sep 6, 2011
  • Latest release: Dec 3, 2021
  • Number of updates: 108
  • Update frequency: every 34.8 days
  • Top authors: mattwiebe (28.7%)zbtirrell (22.22%)borkweb (15.74%)peterchester (12.04%)barry.hughes (10.19%)

Code review

54 tests

User reviews

8 reviews

Install metrics

9,000+ active / 99,136 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼308.88ms] Passed 4 tests

A check of server-side resources used by Advanced Post Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1155.19 ▲5.98
Dashboard /wp-admin3.45 ▲0.0439.71 ▲5.81
Posts /wp-admin/edit.php3.69 ▲0.0438.95 ▲2.76
Add New Post /wp-admin/post-new.php6.92 ▼0.0595.52 ▼1,245.35
Media Library /wp-admin/upload.php3.34 ▲0.0424.34 ▲1.28

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 151 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Post Manager: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4116.28 ▲0.635.94 ▼1.092.85 ▲0.17
Dashboard /wp-admin2,895 ▲346.04 ▼0.15119.68 ▼16.38157.08 ▲0.03
Posts /wp-admin/edit.php2,694 ▼03.23 ▼0.0163.83 ▼0.39142.25 ▲1.78
Add New Post /wp-admin/post-new.php1,680 ▲1920.38 ▲4.68401.52 ▼44.15157.73 ▲3.62
Media Library /wp-admin/upload.php1,695 ▼35.51 ▲0.03142.64 ▼2.70186.61 ▼0.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/advanced-post-manager/views/edit-filters.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/advanced-post-manager/tribe-apm.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

advanced-post-manager/tribe-apm.php 92% from 13 tests

This is the main PHP file of "Advanced Post Manager" version 4.5.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-post-manager.php" instead of "tribe-apm.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin8,826 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
PO File602,3402,5205,250
PHP93863791,852
CSS5144141582
HTML1980409
JavaScript106760372
Markdown1950361

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity60.80
▷ Minimum class complexity19.00
▷ Maximum class complexity101.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods142
▷ Static methods53.52%
▷ Public methods9869.01%
▷ Protected methods3826.76%
▷ Private methods64.23%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.23MB with 0.16MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png106.33KB30.00KB▼ 71.78%
screenshot-1.png126.32KB35.75KB▼ 71.70%