88% prices-only-members-for-woocommerce

Code Review | Prices Only Members for Woocommerce

WordPress plugin Prices Only Members for Woocommerce scored 88% from 53 tests.

About plugin

  • Plugin page: prices-only-membe...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.3
  • WordPress version: 5.8.1
  • First release: Feb 2, 2017
  • Latest release: Mar 18, 2017
  • Number of updates: 7
  • Update frequency: every 6.0 days
  • Top authors: dcurasi (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 617 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼262.33ms] Passed 4 tests

A check of server-side resources used by Prices Only Members for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1829.61 ▲8.60
Dashboard /wp-admin3.13 ▲0.0847.46 ▲0.82
Posts /wp-admin/edit.php3.24 ▲0.1444.11 ▲0.67
Add New Post /wp-admin/post-new.php5.49 ▲0.0692.18 ▼1,040.24
Media Library /wp-admin/upload.php3.07 ▲0.0729.69 ▼10.56
Prices Only Members /wp-admin/admin.php?page=dc-pomfw-menu-page3.0624.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
dc_pomfw_position
dc_pomfw_activate
dc_pomfw_register_text
dc_pomfw_login_text
dc_pomfw_register_link
dc_pomfw_login_link
dc_pomfw_message

Browser metrics Passed 4 tests

An overview of browser requirements for Prices Only Members for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲8515.86 ▲0.338.24 ▼1.4747.50 ▼3.18
Dashboard /wp-admin2,951 ▲1016.14 ▲0.32137.61 ▼0.14104.63 ▲3.18
Posts /wp-admin/edit.php2,720 ▲142.83 ▲0.1370.24 ▲6.6889.04 ▼2.32
Add New Post /wp-admin/post-new.php1,680 ▼17318.79 ▼0.33358.28 ▼17.67105.15 ▲0.10
Media Library /wp-admin/upload.php1,791 ▲165.11 ▲0.08146.98 ▼4.27112.11 ▼2.67
Prices Only Members /wp-admin/admin.php?page=dc-pomfw-menu-page1,2772.0962.2080.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/prices-only-members-for-woocommerce/public/partials/dc-pomfw-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prices-only-members-for-woocommerce/admin/partials/dc-pomfw-admin-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

prices-only-members-for-woocommerce/dc-pomfw.php 85% from 13 tests

"Prices Only Members for Woocommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("prices-only-members-for-woocommerce.php" instead of "dc-pomfw.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected441 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12130595362
PO File1222273
JavaScript24546
CSS2080

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin