84% advanced-post-manager

Code Review | Advanced Post Manager

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

About plugin

  • Plugin page: advanced-post-man...
  • Plugin version: 4.5.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 6, 2011
  • Latest release: Feb 22, 2023
  • Number of updates: 114
  • Update frequency: every 36.9 days
  • Top authors: mattwiebe (27.19%)zbtirrell (21.05%)borkweb (18.42%)peterchester (11.4%)barry.hughes (9.65%)

Code review

54 tests

User reviews

11 reviews

Install metrics

8,000+ active / 128,091 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.40ms] Passed 4 tests

An overview of server-side resources used by Advanced Post Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.08 ▼2.04
Dashboard /wp-admin3.34 ▲0.0446.94 ▼1.28
Posts /wp-admin/edit.php3.46 ▲0.1043.94 ▼3.77
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.67 ▼2.51
Media Library /wp-admin/upload.php3.27 ▲0.0437.99 ▲1.77

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 159 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Post Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.39 ▼1.391.67 ▼0.2143.11 ▼2.01
Dashboard /wp-admin2,209 ▲175.85 ▲0.88101.60 ▼11.2439.20 ▼1.82
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0735.12 ▼4.3132.85 ▼5.04
Add New Post /wp-admin/post-new.php1,517 ▼1117.76 ▼0.42653.82 ▲44.3461.07 ▼4.25
Media Library /wp-admin/upload.php1,391 ▲34.24 ▲0.0697.23 ▲1.9842.56 ▼2.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% 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)
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Codeception\\Actor' not found in wp-content/plugins/advanced-post-manager/tests/_support/IntegrationTester.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Codeception\\Module' not found in wp-content/plugins/advanced-post-manager/tests/_support/Helper/Integration.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Codeception\\TestCase\\WPTestCase' not found in wp-content/plugins/advanced-post-manager/tests/integration/Tribe_FiltersTest.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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/advanced-post-manager/views/edit-filters.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

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

The main PHP script in "Advanced Post Manager" version 4.5.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin6,377 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PO File311,2091,3022,697
PHP134074051,931
CSS5144141582
HTML1980409
JavaScript106760373
Markdown1950361
YAML10024

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity38.88
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods145
▷ Static methods53.45%
▷ Public methods10169.66%
▷ Protected methods3826.21%
▷ Private methods64.14%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
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%