78% pricing-tables

Code Review | Pricing Tables

WordPress plugin Pricing Tables scored 78% from 54 tests.

About plugin

  • Plugin page: pricing-tables
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 17, 2014
  • Latest release: Dec 5, 2016
  • Number of updates: 59
  • Update frequency: every 15.8 days
  • Top authors: kentothemes (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active / 7,522 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Pricing Tables
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2041.43 ▼11.34
Dashboard /wp-admin3.51 ▲0.2048.04 ▼0.66
Posts /wp-admin/edit.php3.56 ▲0.2050.56 ▲3.40
Add New Post /wp-admin/post-new.php6.09 ▲0.2098.64 ▼9.73
Media Library /wp-admin/upload.php3.43 ▲0.2038.37 ▲0.78
WPT /wp-admin/edit.php?post_type=wpt3.4737.95
WPT Info /wp-admin/edit.php?post_type=wpt&page=wpt_settings3.4032.85
Add New WPT /wp-admin/post-new.php?post_type=wpt3.4454.63

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Pricing Tables: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲24913.90 ▼0.575.86 ▲3.9844.22 ▲0.51
Dashboard /wp-admin2,245 ▲575.12 ▼0.78115.71 ▲12.1978.80 ▲36.66
Posts /wp-admin/edit.php2,148 ▲562.32 ▲0.2639.47 ▼2.0434.97 ▼2.14
Add New Post /wp-admin/post-new.php1,718 ▲20422.50 ▲5.03594.14 ▼117.4834.63 ▼20.86
Media Library /wp-admin/upload.php1,445 ▲574.45 ▲0.20104.07 ▼9.2374.91 ▲28.58
WPT /wp-admin/edit.php?post_type=wpt1,1122.2535.3331.98
WPT Info /wp-admin/edit.php?post_type=wpt&page=wpt_settings1,4109.26297.6177.19
Add New WPT /wp-admin/post-new.php?post_type=wpt1,9912.8554.6291.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 34 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Warning in wp-content/plugins/pricing-tables/index.php+446
    Cannot assign an empty string to a string offset
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+451
    Uninitialized string offset: 1
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+451
    Uninitialized string offset: 2
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+451
    Uninitialized string offset: 3
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 13
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 23
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 33
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 14
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 24
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 34
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 15
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 25
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 35
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 16
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 26
    • > GET request to /wp-admin/post-new.php?post_type=wpt
    • > Notice in wp-content/plugins/pricing-tables/index.php+461
    Uninitialized string offset: 36

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pricing-tables/index.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/pricing-tables/wpt-admin.php:2

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Normal View.), #2 (Admin Settings.), #3 (Themes One.), #4 (Themes two.), #5 (Themes Three.)
The official readme.txt is a good inspiration

pricing-tables/index.php 92% from 13 tests

The primary PHP file in "Pricing Tables" version 1.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("pricing-tables.php" instead of "index.php")

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
Everything looks great! No dangerous files found in this plugin2,484 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4670341,530
CSS55771915
JavaScript130239

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
17 PNG files occupy 0.12MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/monsoon/cross-red.png3.05KB0.35KB▼ 88.36%
themes/ultra/cross-red.png3.05KB0.35KB▼ 88.36%
themes/ultra/ok-green.png3.13KB0.53KB▼ 83.20%
themes/flat/ok.png3.10KB0.55KB▼ 82.23%
themes/flat/cross-red.png3.05KB0.35KB▼ 88.36%