72% advance-post-prefix

Code Review | Advance Post Prefix

WordPress plugin Advance Post Prefix scored72%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: 6.3.1
  • 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 /1,155 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.17MB] [CPU: ▼17.47ms] Passed 4 tests

A check of server-side resources used by Advance Post Prefix
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0347.42 ▲3.93
Dashboard /wp-admin3.14 ▼0.1631.83 ▼23.78
Posts /wp-admin/edit.php3.27 ▼0.0838.30 ▼8.39
Add New Post /wp-admin/post-new.php5.47 ▼0.4275.45 ▼28.42
Media Library /wp-admin/upload.php3.21 ▼0.0228.47 ▼9.28
Post Prefix /wp-admin/admin.php?page=advance-post-prefix3.1229.89
Add new /wp-admin/admin.php?page=add-prefix3.1229.47

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: 1 new table, 6 new options
New tables
wp_post_prefix
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Advance Post Prefix
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲9114.37 ▲0.022.15 ▼0.0445.35 ▲1.59
Dashboard /wp-admin2,258 ▲815.62 ▼0.0496.54 ▲4.7882.44 ▲39.54
Posts /wp-admin/edit.php2,162 ▲592.02 ▲0.0240.98 ▲2.0234.37 ▼1.59
Add New Post /wp-admin/post-new.php1,566 ▲3823.00 ▼0.12666.56 ▲48.07170.99 ▲116.55
Media Library /wp-admin/upload.php1,432 ▲384.25 ▲0.01102.78 ▼2.5764.04 ▲17.80
Post Prefix /wp-admin/admin.php?page=advance-post-prefix8462.1933.8531.47
Add new /wp-admin/admin.php?page=add-prefix8572.0124.9129.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/advance-post-prefix/wpp_add.php
    • > /wp-content/plugins/advance-post-prefix/prefix_choose.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in advance-post-prefix/assets to your readme.txt
  • Plugin Name: Please specify the plugin name on the first line ( === advance-post-prefix === )
You can look at the official readme.txt

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

The main PHP script in "Advance Post Prefix" version 1.1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 159 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("advance-post-prefix.php" instead of "advance_post_prefix.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin241 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP41723241

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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%