78% payhip-sell-ebooks

Code Review | Payhip - Sell Downloads

WordPress plugin Payhip - Sell Downloads scored78%from 54 tests.

About plugin

  • Plugin page: payhip-sell-ebooks
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Jun 5, 2015
  • Latest release: Aug 2, 2018
  • Number of updates: 21
  • Update frequency: every 55.0 days
  • Top authors: payhip (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active /8,405 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼7.51ms] Passed 4 tests

Server-side resources used by Payhip - Sell Downloads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.44 ▲2.74
Dashboard /wp-admin3.41 ▲0.1050.28 ▲2.27
Posts /wp-admin/edit.php3.52 ▲0.1645.27 ▼7.96
Add New Post /wp-admin/post-new.php5.99 ▲0.1082.62 ▼27.08
Media Library /wp-admin/upload.php3.33 ▲0.1038.89 ▲5.30

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payhip - Sell Downloads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲19813.66 ▼0.9811.66 ▲9.8143.26 ▼6.14
Dashboard /wp-admin2,222 ▲344.86 ▼0.04113.80 ▲10.3244.39 ▲5.20
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0233.80 ▼2.2132.53 ▼2.17
Add New Post /wp-admin/post-new.php1,533 ▼922.98 ▲4.61679.70 ▲76.3356.23 ▲7.90
Media Library /wp-admin/upload.php1,407 ▲224.21 ▲0.0395.32 ▲0.1545.06 ▲0.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/payhip-sell-ebooks/public/views/public.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/payhip-sell-ebooks/includes/general.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/payhip-sell-ebooks/admin/views/admin.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/payhip-sell-ebooks/includes/general.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: You are using too many tags: 23 tag instead of maximum 10
The official readme.txt might help

payhip-sell-ebooks/payhip-sell-ebooks.php 92% from 13 tests

"Payhip - Sell Downloads" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin716 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9143511577
JavaScript42522109
CSS28530

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity41.50
▷ Minimum class complexity35.00
▷ Maximum class complexity48.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods725.93%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants1493.33%
▷ Class constants16.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin