82% advance-post-prefix

Code Review | Advance Post Prefix

WordPress plugin Advance Post Prefix scored 82% from 54 tests.

About plugin

  • Plugin page: advance-post-prefix
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.4
  • WordPress version: 5.9.2
  • First release: Mar 15, 2013
  • Latest release: Mar 17, 2013
  • Number of updates: 15
  • Update frequency: every 0.1 days
  • Top authors: niceit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 999 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.34MB] [CPU: ▼303.45ms] Passed 4 tests

Analyzing server-side resources used by Advance Post Prefix
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0653.56 ▲1.67
Dashboard /wp-admin3.28 ▼0.1321.77 ▼11.29
Posts /wp-admin/edit.php3.33 ▼0.3122.14 ▼15.28
Add New Post /wp-admin/post-new.php6.08 ▼0.8978.09 ▼1,173.48
Media Library /wp-admin/upload.php3.29 ▼0.0218.03 ▼13.73
Post Prefix /wp-admin/admin.php?page=advance-post-prefix3.2620.13
Add new /wp-admin/admin.php?page=add-prefix3.2620.85

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 6 new files
Database: 1 new table, no new options
New tables

Browser metrics Passed 4 tests

A check of browser resources used by Advance Post Prefix
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,849 ▲9616.20 ▲0.435.76 ▼0.202.30 ▼0.94
Dashboard /wp-admin2,957 ▲966.25 ▲0.10123.10 ▼14.12195.06 ▲30.03
Posts /wp-admin/edit.php2,747 ▲593.14 ▼0.1066.78 ▲4.66151.52 ▲4.21
Add New Post /wp-admin/post-new.php1,685 ▼2616.29 ▼4.48406.11 ▼53.74199.30 ▲42.26
Media Library /wp-admin/upload.php1,732 ▲345.61 ▲0.09123.46 ▼22.46198.83 ▲5.40
Post Prefix /wp-admin/admin.php?page=advance-post-prefix1,0612.5354.12102.79
Add new /wp-admin/admin.php?page=add-prefix1,0722.4052.81113.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-prefix
    • > Notice in wp-content/plugins/advance-post-prefix/advance_post_prefix.php+88
    Undefined index: post

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advance-post-prefix/wpp_add.php
    • > /wp-content/plugins/advance-post-prefix/prefix_choose.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/advance-post-prefix/wpp_dashboard.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/advance-post-prefix/wpp_dashboard.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advance-post-prefix/advance_post_prefix.php:173
    • > PHP Notice
      Undefined variable: prefix in wp-content/plugins/advance-post-prefix/wpp_dashboard.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === advance-post-prefix === )
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in advance-post-prefix/assets to your readme.txt
The official readme.txt is a good inspiration

advance-post-prefix/advance_post_prefix.php 85% from 13 tests

The principal PHP file in "Advance Post Prefix" v. 1.1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advance-post-prefix.php" instead of "advance_post_prefix.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 159 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected241 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions11100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
post-prefix-ico.png3.13KB0.75KB▼ 76.13%