83% pricing-table

Code Review | Pricing Table

WordPress plugin Pricing Table scored 83% from 54 tests.

About plugin

  • Plugin page: pricing-table
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.3.2
  • WordPress version: 5.8.1
  • First release: Nov 29, 2011
  • Latest release: Feb 17, 2020
  • Number of updates: 91
  • Update frequency: every 33.0 days
  • Top authors: codename065 (100%)

Code review

54 tests

User reviews

88 reviews

Install metrics

3,000+ active / 340,883 total downloads

Benchmarks

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.04MB] [CPU: ▼138.87ms] Passed 4 tests

A check of server-side resources used by Pricing Table
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0433.25 ▼0.69
Dashboard /wp-admin3.10 ▲0.0446.36 ▲4.65
Posts /wp-admin/edit.php3.18 ▲0.0849.30 ▲7.32
Add New Post /wp-admin/post-new.php5.47 ▲0.0391.79 ▼555.17
Media Library /wp-admin/upload.php3.04 ▲0.0334.88 ▼4.26
Add New /wp-admin/post-new.php?post_type=pricing-table3.2549.67
All Pricing Tables /wp-admin/edit.php?post_type=pricing-table3.0830.44
Help /wp-admin/edit.php?post_type=pricing-table&page=help3.0426.75
Shortcodes /wp-admin/edit.php?post_type=pricing-table&page=short-codes3.0630.65

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 87 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Pricing Table
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲16115.87 ▲0.399.28 ▼3.1245.60 ▲0.97
Dashboard /wp-admin3,015 ▲815.99 ▲0.05160.11 ▲21.61118.22 ▲14.29
Posts /wp-admin/edit.php2,787 ▲482.70 ▲0.0264.41 ▲3.3891.89 ▲10.88
Add New Post /wp-admin/post-new.php1,715 ▲10018.74 ▼3.00384.86 ▲117.84113.99 ▲10.52
Media Library /wp-admin/upload.php1,855 ▲455.05 ▲0.01156.16 ▲1.06114.44 ▼6.65
Add New /wp-admin/post-new.php?post_type=pricing-table2,4404.22104.61131.79
All Pricing Tables /wp-admin/edit.php?post_type=pricing-table1,4662.6362.8173.49
Help /wp-admin/edit.php?post_type=pricing-table&page=help1,1742.0956.4290.44
Shortcodes /wp-admin/edit.php?post_type=pricing-table&page=short-codes1,2372.3457.2590.70

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 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Warning in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php+119
    array_keys() expects parameter 1 to be array, string given
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Notice in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php+120
    Undefined offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Notice in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php+120
    String offset cast occurred
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Notice in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php+120
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Warning in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php+120
    count(): Parameter must be an array or an object that implements Countable

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
Please take a closer look at the following
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pricing-table/tpls/short-codes.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pricing-table/modules/metabox.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pricing-table/tpls/help.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pricing-table/modules/metabox.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pricing-table/table-templates/rock/price_table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/pricing-table/tpls/metabox-feature-options.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pricing-table/table-templates/smooth/price_table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pricing-table/modules/wppt-free-mce-button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pricing-table/table-templates/override/price_table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pricing-table/table-templates/bold/price_table.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=pricing-table
    • > Network (severe)
    wp-content/plugins/pricing-table/css/site/tipTip.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=pricing-table&page=short-codes
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=pricing-table&page=short-codes 247:22 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

pricing-table/pricing-table.php Passed 13 tests

The main PHP file in "Pricing Table" ver. 1.5.2 adds more information about the plugin and also serves as the entry point for this plugin
54 characters long description:
WordPress Plugin for creating colorful pricing tables.

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
Success! There were no dangerous files found in this plugin12,872 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
CSS1361412710,507
PHP12261261,611
JavaScript7132327657
PO File1404197

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
44 PNG files occupy 0.18MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
table-templates/override/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
table-templates/smooth/images/bestvalue4.png5.13KB2.05KB▼ 60.07%
css/admin/table-images/right.png0.21KB0.17KB▼ 18.64%
images/minimax.v3.png63.56KB28.36KB▼ 55.38%
images/edit-desc.png0.73KB0.84KB0.00%