84% ya-pricing-table

Code Review | Yet another pricing table Plugin

WordPress plugin Yet another pricing table Plugin scored84%from 54 tests.

About plugin

  • Plugin page: ya-pricing-table
  • Plugin version: 3.1.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2021
  • Latest release: Apr 6, 2023
  • Number of updates: 13
  • Update frequency: every 45.7 days
  • Top authors: bcripts (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

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

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

This is a short check of server-side resources used by Yet another pricing table Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.61 ▼0.89
Dashboard /wp-admin3.33 ▲0.0344.92 ▼1.75
Posts /wp-admin/edit.php3.44 ▲0.0947.25 ▲2.00
Add New Post /wp-admin/post-new.php5.93 ▲0.0597.60 ▼3.05
Media Library /wp-admin/upload.php3.25 ▲0.0334.82 ▲2.61
Add New /wp-admin/admin.php?page=yapt_admin_add_page3.3249.74
YA Pricing Table /wp-admin/admin.php?page=yapt_admin3.2534.31

Server storage [IO: ▲2.01MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 58 new files
Database: 5 new tables, 6 new options
New tables
wp_yapt_templates
wp_yapt_columns
wp_yapt_features
wp_yapt_pricing_tables
wp_yapt_currency
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Yet another pricing table Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲20114.46 ▼0.195.23 ▲3.3137.75 ▼7.37
Dashboard /wp-admin2,244 ▲566.06 ▲1.18116.14 ▼1.0541.56 ▼6.53
Posts /wp-admin/edit.php2,121 ▲352.63 ▲0.6244.48 ▲4.7435.88 ▲1.19
Add New Post /wp-admin/post-new.php1,698 ▲17023.47 ▲0.23594.58 ▼30.9733.64 ▼27.06
Media Library /wp-admin/upload.php1,423 ▲385.22 ▲1.04106.21 ▲6.8740.67 ▼3.27
Add New /wp-admin/admin.php?page=yapt_admin_add_page1,6292.4442.8545.67
YA Pricing Table /wp-admin/admin.php?page=yapt_admin1,0102.3235.2126.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/ya-pricing-table/admin/partials/yapt-admin-add-page.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ya-pricing-table/admin/partials/yapt-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Type' not found in wp-content/plugins/ya-pricing-table/Type/Feature.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/ya-pricing-table/includes/yapt_list.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Type' not found in wp-content/plugins/ya-pricing-table/Type/PriceTable.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Type' not found in wp-content/plugins/ya-pricing-table/Type/Column.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/ya-pricing-table/admin/partials/yapt-admin-edit.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: price table, pricing table, table, price, dynamic pricing table...

ya-pricing-table/yapt.php 92% from 13 tests

This is the main PHP file of "Yet another pricing table Plugin" version 3.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ya-pricing-table.php" instead of "yapt.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
No dangerous file extensions were detected16,149 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33,0772,13313,608
PHP192387321,377
CSS518170984
PO File1315876
HTML31058
SVG20228
Markdown15018

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.85
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods55
▷ Static methods712.73%
▷ Public methods4887.27%
▷ Protected methods00.00%
▷ Private methods712.73%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
10 PNG files occupy 0.35MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png32.24KB14.24KB▼ 55.84%
assets/banner-1544x500.png76.57KB30.74KB▼ 59.85%
templates/yapt2021/yapt2021.png31.55KB13.69KB▼ 56.63%
assets/banner-1544x500-rtl.png82.39KB34.25KB▼ 58.44%
assets/screenshot-2.png31.55KB13.69KB▼ 56.63%