84% advance-pricing-table

Code Review | Advance Pricing Table

WordPress plugin Advance Pricing Table scored84%from 54 tests.

About plugin

  • Plugin page: advance-pricing-t...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Mar 19, 2015
  • Latest release: May 20, 2018
  • Number of updates: 9
  • Update frequency: every 128.8 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,854 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.54ms] Passed 4 tests

An overview of server-side resources used by Advance Pricing Table
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0347.82 ▲9.42
Dashboard /wp-admin3.37 ▲0.0348.02 ▼6.08
Posts /wp-admin/edit.php3.49 ▲0.0951.42 ▲1.93
Add New Post /wp-admin/post-new.php5.95 ▲0.0386.98 ▼23.42
Media Library /wp-admin/upload.php3.30 ▲0.0347.66 ▲9.98

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Advance Pricing Table: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.34 ▼0.241.69 ▲0.0242.69 ▲0.87
Dashboard /wp-admin2,202 ▲225.56 ▼0.0285.94 ▼5.2136.30 ▼10.18
Posts /wp-admin/edit.php2,104 ▲71.99 ▲0.0135.22 ▼2.4330.55 ▼9.55
Add New Post /wp-admin/post-new.php1,530 ▲323.17 ▼0.02668.10 ▲26.1953.37 ▲0.95
Media Library /wp-admin/upload.php1,404 ▲104.21 ▲0.0299.05 ▼1.7544.90 ▲0.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advance-pricing-table/includes/wpb_shortcode.php:103

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 93% from 29 tests

readme.txt 94% 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 to be fixed:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

advance-pricing-table/main.php 92% from 13 tests

The principal PHP file in "Advance Pricing Table" v. 1.0.1 is loaded by WordPress automatically on each request
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 ("advance-pricing-table.php" instead of "main.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
Success! There were no dangerous files found in this plugin1,041 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS288897
PHP44742144

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.58
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.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