78% easy-way-to-sell-digital-goods-with-payhip

Code Review | Easy Way to Sell Digital Goods with Payhip

WordPress plugin Easy Way to Sell Digital Goods with Payhip scored78%from 54 tests.

About plugin

  • Plugin page: easy-way-to-sell-...
  • Plugin version: 1.2.10
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 16, 2023
  • Latest release: Jan 25, 2023
  • Number of updates: 13
  • Update frequency: every 0.7 days
  • Top authors: jodacame (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /632 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼1.31ms] Passed 4 tests

Analyzing server-side resources used by Easy Way to Sell Digital Goods with Payhip
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.42 ▲3.25
Dashboard /wp-admin3.53 ▲0.2256.74 ▲5.56
Posts /wp-admin/edit.php3.64 ▲0.2849.60 ▼0.69
Add New Post /wp-admin/post-new.php6.18 ▲0.2988.91 ▼13.09
Media Library /wp-admin/upload.php3.45 ▲0.2240.54 ▲5.31
All Items /wp-admin/edit.php?post_type=payhip-sell-digital3.4941.78
Add New /wp-admin/post-new.php?post_type=payhip-sell-digital6.1882.98

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
wp_payhip_sell_digital_review_notice
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Way to Sell Digital Goods with Payhip
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,019 ▲25814.33 ▼0.0824.25 ▲22.5945.69 ▲6.49
Dashboard /wp-admin2,222 ▲425.63 ▼0.0181.26 ▼4.4138.21 ▼4.42
Posts /wp-admin/edit.php2,127 ▲271.98 ▲0.0136.87 ▲2.7737.62 ▲3.91
Add New Post /wp-admin/post-new.php1,558 ▲3218.08 ▼4.99623.03 ▼49.3762.88 ▲6.35
Media Library /wp-admin/upload.php1,424 ▲244.16 ▲0.01102.83 ▲1.3944.85 ▲0.11
All Items /wp-admin/edit.php?post_type=payhip-sell-digital1,1361.9534.3230.87
Add New /wp-admin/post-new.php?post_type=payhip-sell-digital6,34720.52861.2537.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • wp_payhip_sell_digital_review_notice
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/public/template/shortcode/lists.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PAYHIP_SELL_DIGITAL_PATH - assumed 'WP_PAYHIP_SELL_DIGITAL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/admin/load.php on line 3
    • > PHP Warning
      require_once(WP_PAYHIP_SELL_DIGITAL_PATHadmin/inc/CustomPost.class.php): failed to open stream: No such file or directory in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/admin/load.php on line 3
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/public/template/shortcode/lists.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/public/template/shortcode/lists.php on line 2
    • > PHP Notice
      Undefined variable: cols in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/public/template/shortcode/lists.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PAYHIP_SELL_DIGITAL_PATHadmin/inc/CustomPost.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/admin/load.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/admin/views/meta-box.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/easy-way-to-sell-digital-goods-with-payhip/public/template/product.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

easy-way-to-sell-digital-goods-with-payhip/index.php 85% from 13 tests

The entry point to "Easy Way to Sell Digital Goods with Payhip" version 1.2.10 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 351 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easy-way-to-sell-digital-goods-with-payhip.php" instead of "index.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
No dangerous file extensions were detected2,032 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP11263831,409
CSS2408508
JavaScript220111
SVG4004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity6.71
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods39.09%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/default.png156.19KB109.74KB▼ 29.74%