68% triple-pricing-table

Code Review | TRIPLE PRICING TABLE

WordPress plugin TRIPLE PRICING TABLE scored68%from 54 tests.

About plugin

  • Plugin page: triple-pricing-table
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Oct 5, 2015
  • Latest release: Jun 11, 2018
  • Number of updates: 18
  • Update frequency: every 54.6 days
  • Top authors: extendyourweb (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,419 total downloads

Benchmarks

Plugin footprint 65% 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.20MB] [CPU: ▼4.89ms] Passed 4 tests

Server-side resources used by TRIPLE PRICING TABLE
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2036.74 ▼8.80
Dashboard /wp-admin3.51 ▲0.2056.89 ▲5.85
Posts /wp-admin/edit.php3.56 ▲0.2045.43 ▼4.77
Add New Post /wp-admin/post-new.php6.11 ▲0.2288.43 ▼5.45
Media Library /wp-admin/upload.php3.43 ▲0.2035.62 ▼0.54
Triple Pricing Table /wp-admin/options-general.php?page=pricingtable3.4057.23

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 64 new files
Database: 1 new table, 6 new options
New tables
wp_pricingtableconfig
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

TRIPLE PRICING TABLE: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.74 ▼0.571.72 ▼0.3891.07 ▲47.05
Dashboard /wp-admin2,229 ▲385.09 ▲0.19125.66 ▲23.8043.60 ▲0.99
Posts /wp-admin/edit.php2,114 ▲252.31 ▲0.3040.09 ▲2.9433.48 ▼0.40
Add New Post /wp-admin/post-new.php1,531 ▼223.47 ▲0.27647.68 ▼35.0838.67 ▼27.48
Media Library /wp-admin/upload.php1,411 ▲204.39 ▲0.0599.16 ▼7.6644.12 ▼1.42
Triple Pricing Table /wp-admin/options-general.php?page=pricingtable8211.9626.7931.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_pricingtableconfig
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/triple-pricing-table/init.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/triple-pricing-table/assets/wp_bootstrap_navwalker.php:13

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)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=pricingtable
    • > Network (severe)
    wp-content/plugins/triple-pricing-table/script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Triple Pricing Header.), #2 (Admin page screenshot.), #3 (Customization options.)
  • Tags: There are too many tags (31 tag instead of maximum 10)
The official readme.txt is a good inspiration

triple-pricing-table/init.php 92% from 13 tests

"TRIPLE PRICING TABLE" version 2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("triple-pricing-table.php" instead of "init.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
Everything looks great! No dangerous files found in this plugin15,704 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
CSS878949,417
JavaScript35771971,563
Sass1431261,544
LESS1431361,534
SVG200928
PHP212593600
Markdown1370118

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity9.50
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png19.10KB6.48KB▼ 66.05%
assets/icon-128x128.png3.87KB1.70KB▼ 56.17%