78% os-pricing-tables

Code Review | OS Pricing Tables

WordPress plugin OS Pricing Tables scored78%from 54 tests.

About plugin

  • Plugin page: os-pricing-tables
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7.4
  • WordPress version: 6.3.1
  • First release: Jan 5, 2016
  • Latest release: Apr 24, 2017
  • Number of updates: 4
  • Update frequency: every 119.0 days
  • Top authors: offshorent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,117 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼2.85ms] Passed 4 tests

This is a short check of server-side resources used by OS Pricing Tables
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2544.34 ▲0.16
Dashboard /wp-admin3.59 ▲0.2851.06 ▲1.09
Posts /wp-admin/edit.php3.68 ▲0.3351.70 ▲2.17
Add New Post /wp-admin/post-new.php6.28 ▲0.3981.94 ▼10.17
Media Library /wp-admin/upload.php3.52 ▲0.2937.08 ▼2.49
About /wp-admin/edit.php?post_type=ospt-pricing-table&page=about-developer3.4635.32
Add New /wp-admin/post-new.php?post_type=ospt-pricing-table3.5544.00
Pricing Table /wp-admin/edit.php?post_type=ospt-pricing-table3.5239.62

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for OS Pricing Tables
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲25514.14 ▼0.4814.28 ▲11.7655.31 ▲11.21
Dashboard /wp-admin2,258 ▲705.05 ▼0.77101.21 ▼7.3640.17 ▼2.80
Posts /wp-admin/edit.php2,145 ▲562.34 ▲0.3536.62 ▼1.6635.53 ▲0.51
Add New Post /wp-admin/post-new.php1,556 ▲2817.83 ▼0.45685.49 ▲17.9737.19 ▼24.24
Media Library /wp-admin/upload.php1,440 ▲554.55 ▲0.39107.82 ▲3.2451.06 ▲2.06
About /wp-admin/edit.php?post_type=ospt-pricing-table&page=about-developer1,0272.0531.8830.13
Add New /wp-admin/post-new.php?post_type=ospt-pricing-table4,5963.08100.2660.62
Pricing Table /wp-admin/edit.php?post_type=ospt-pricing-table1,1332.3037.3528.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Warning in wp-content/plugins/os-pricing-tables/includes/admin/ospt-post-types.php+175
    Illegal string offset 'settings'
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/ospt-post-types.php+175
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.packages.php+164
    Undefined variable: i
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Warning in wp-content/plugins/os-pricing-tables/includes/admin/ospt-post-types.php+175
    Illegal string offset 'general'
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+82
    Undefined variable: paypal_sandbox
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+87
    Undefined variable: paypal_email
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+92
    Undefined variable: return_url
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+97
    Undefined variable: cancel_url
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+105
    Undefined variable: authorize_sandbox
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+110
    Undefined variable: login_id
    • > GET request to /wp-admin/post-new.php?post_type=ospt-pricing-table
    • > Notice in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php+115
    Undefined variable: transaction_key

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
The following issues need your attention
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.packages.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/templates/ospt.design-6.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/templates/ospt.design-4.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/templates/ospt.design-1.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.designs.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/templates/ospt.design-2.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptPostTypes' not found in wp-content/plugins/os-pricing-tables/includes/templates/ospt.design-5.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osptCountries' not found in wp-content/plugins/os-pricing-tables/includes/admin/meta-boxes/views/ospt.general.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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 need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Pricing tables admin listing), #2 (Package setting area in admin side), #3 (Design setting area in admin side), #4 (Global setting area in admin side), #5 (OS pricing table design 1), #6 (OS pricing table design 2), #7 (OS pricing table design 3), #8 (OS pricing table design 4), #9 (OS pricing table design 5), #10 (OS pricing table design 6)
You can look at the official readme.txt

os-pricing-tables/ospt-pricing-tables.php 92% from 13 tests

The main PHP script in "OS Pricing Tables" version 1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("os-pricing-tables.php" instead of "ospt-pricing-tables.php")

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
Everything looks great! No dangerous files found in this plugin3,841 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP254395622,913
SVG200808
JavaScript651375
CSS461945

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods73
▷ Static methods34.11%
▷ Public methods6791.78%
▷ Protected methods00.00%
▷ Private methods68.22%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
20 PNG files occupy 0.91MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/social.png1.61KB1.12KB▼ 30.45%
screenshot-3.png393.82KB101.84KB▼ 74.14%
screenshot-6.png48.08KB16.44KB▼ 65.81%
images/tick.png3.83KB0.43KB▼ 88.87%
colorbox/images/border.png0.14KB0.16KB0.00%