84% wpm-only-one-buy-by-all-time-free-by-wp-masters

Code Review | One-Time Products Purchases for Woo - Free by WP Masters

WordPress plugin One-Time Products Purchases for Woo - Free by WP Masters scored84%from 54 tests.

About plugin

  • Plugin page: wpm-only-one-buy-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jul 30, 2022
  • Latest release: Mar 28, 2023
  • Number of updates: 3
  • Update frequency: every 81.7 days
  • Top authors: wpmasterscom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /879 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
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.71ms] Passed 4 tests

This is a short check of server-side resources used by One-Time Products Purchases for Woo - Free by WP Masters
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0453.59 ▲4.98
Dashboard /wp-admin3.35 ▲0.0553.80 ▼1.06
Posts /wp-admin/edit.php3.40 ▲0.0454.29 ▼3.30
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.31 ▼3.45
Media Library /wp-admin/upload.php3.27 ▲0.0442.14 ▲6.98

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by One-Time Products Purchases for Woo - Free by WP Masters
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6015.36 ▲1.111.69 ▼0.3042.75 ▼4.83
Dashboard /wp-admin2,224 ▲476.99 ▲1.3098.84 ▲0.7342.31 ▼1.94
Posts /wp-admin/edit.php2,132 ▲294.18 ▲2.1744.42 ▲6.4335.47 ▼2.56
Add New Post /wp-admin/post-new.php6,273 ▲4,74523.25 ▲0.15957.13 ▲259.6736.75 ▼19.02
Media Library /wp-admin/upload.php1,432 ▲326.52 ▲2.38108.69 ▼3.6342.24 ▼2.46

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-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% 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 | 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 take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpm-only-one-buy-by-all-time-free-by-wp-masters/templates/admin/settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wpm-only-one-buy-by-all-time-free-by-wp-masters/wpm-only-one-buy-all-time.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
9 plugin tags: single purchase, restrict buy, product buy once, one buy, limit product buy...

wpm-only-one-buy-by-all-time-free-by-wp-masters/wpm-only-one-buy-all-time.php 85% from 13 tests

The principal PHP file in "One-Time Products Purchases for Woo - Free by WP Masters" v. 1.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpm-only-one-buy-by-all-time-free-by-wp-masters.php" instead of "wpm-only-one-buy-all-time.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected11,057 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG3009,552
CSS31435884
PHP23057356
JavaScript3105265

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
templates/assets/img/logo.png11.32KB4.55KB▼ 59.79%