87% advanced-pricing-table

Code Review | Advanced Pricing Table

WordPress plugin Advanced Pricing Table scored 87% from 54 tests.

About plugin

  • Plugin page: advanced-pricing-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.2
  • WordPress version: 5.8.1
  • First release: Jan 28, 2018
  • Latest release: Nov 15, 2018
  • Number of updates: 6
  • Update frequency: every 49.3 days
  • Top authors: mithublue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 453 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
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼147.15ms] 75% from 4 tests

An overview of server-side resources used by Advanced Pricing Table
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 2,822.86ms on /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php)
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1338.02 ▲2.84
Dashboard /wp-admin3.25 ▲0.2050.54 ▲4.19
Posts /wp-admin/edit.php3.30 ▲0.2052.45 ▲0.43
Add New Post /wp-admin/post-new.php5.55 ▲0.1199.14 ▼591.80
Media Library /wp-admin/upload.php3.26 ▲0.2539.97 ▼0.08
All Pricing Tables /wp-admin/edit.php?post_type=wppt_pricing_table3.2934.96
Add New /wp-admin/post-new.php?post_type=wppt_pricing_table3.3046.36
Cybercraft Products /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php3.352,822.86

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Pricing Table
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,027 ▲1,43115.83 ▲0.2612.60 ▲3.0151.07 ▲3.68
Dashboard /wp-admin4,289 ▲1,3556.00 ▲0.08144.37 ▼11.09115.06 ▼19.17
Posts /wp-admin/edit.php4,046 ▲1,3102.59 ▼0.1066.03 ▼4.42104.76 ▲14.61
Add New Post /wp-admin/post-new.php2,806 ▲1,12318.58 ▲2.32378.93 ▼32.45117.98 ▲3.71
Media Library /wp-admin/upload.php3,126 ▲1,3165.00 ▼0.02160.21 ▼5.52126.52 ▼1.04
All Pricing Tables /wp-admin/edit.php?post_type=wppt_pricing_table2,7262.6265.5171.92
Add New /wp-admin/post-new.php?post_type=wppt_pricing_table4,6035.00135.30155.43
Cybercraft Products /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php2,8332.1860.2671.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 42 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php
    • > Notice in wp-content/plugins/advanced-pricing-table/more-products.php+33
    Trying to get property 'slug' of non-object
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php
    • > Notice in wp-content/plugins/advanced-pricing-table/more-products.php+31
    Trying to get property 'name' of non-object
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wppt_pricing_table&page=advanced-pricing-table/more-products.php
    • > Notice in wp-content/plugins/advanced-pricing-table/more-products.php+32
    Trying to get property 'short_description' of non-object

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
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advanced-pricing-table/shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-pricing-table/pricing-templates.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-pricing-table/pricing-table-admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-pricing-table/register-data.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-pricing-table/more-products.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/advanced-pricing-table/pricing-table-data.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can look at the official readme.txt

advanced-pricing-table/advanced-pricing-table.php 85% from 13 tests

The principal PHP file in "Advanced Pricing Table" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin14,383 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,0671,3408,995
LESS2274302,058
CSS45181,602
PHP772411,524
SVG200204

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.25
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods523.81%
▷ Public methods2095.24%
▷ Protected methods14.76%
▷ Private methods00.00%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants5
▷ Global constants5100.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
4 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/templates/yama.png31.90KB8.99KB▼ 71.83%
assets/images/templates/jinpa.png27.18KB8.44KB▼ 68.97%
assets/images/templates/sonam.png24.11KB8.00KB▼ 66.81%
assets/images/templates/tenzin.png14.52KB5.50KB▼ 62.10%