94% opal-estate-packages

Code Review | Opal Estate Packages

WordPress plugin Opal Estate Packages scored 94% from 54 tests.

About plugin

  • Plugin page: opal-estate-packages
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2.3
  • WordPress version: 5.8.1
  • First release: Sep 23, 2019
  • Latest release: Aug 1, 2020
  • Number of updates: 13
  • Update frequency: every 24.3 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,416 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼139.45ms] Passed 4 tests

An overview of server-side resources used by Opal Estate Packages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1346.52 ▲23.88
Dashboard /wp-admin3.07 ▲0.0246.40 ▲1.01
Posts /wp-admin/edit.php3.12 ▲0.0249.89 ▲2.39
Add New Post /wp-admin/post-new.php5.43 ▼0.00100.60 ▼563.53
Media Library /wp-admin/upload.php3.02 ▲0.0138.15 ▲2.34

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Opal Estate Packages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲11115.89 ▲0.3310.14 ▼1.0849.31 ▼6.62
Dashboard /wp-admin3,001 ▲705.98 ▼0.05149.48 ▼3.18132.10 ▲9.62
Posts /wp-admin/edit.php2,767 ▲282.73 ▲0.0366.37 ▼2.7898.54 ▲6.52
Add New Post /wp-admin/post-new.php1,701 ▲1818.79 ▲0.05394.39 ▼7.08108.68 ▼9.77
Media Library /wp-admin/upload.php1,838 ▲285.01 ▼0.01159.25 ▼10.27124.87 ▼5.60

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
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Opalestate_Packages\\Core\\Query' not found in wp-content/plugins/opal-estate-packages/templates/packages.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/opal-estate-packages/templates/account/membership-warning.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/opal-estate-packages/loader.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opal-estate-packages/inc/functions.php:167
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/opal-estate-packages/templates/content-package.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function opalestate_packages_is_unlimited_purchased() in wp-content/plugins/opal-estate-packages/templates/checkout/limited-purchased.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: subscription, member, profile, membership, opalestate_addon...

opal-estate-packages/opal-estate-packages.php 85% from 13 tests

This is the main PHP file of "Opal Estate Packages" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.0.0")
  • Description: Please keep the plugin description shorter than 140 characters (currently 166 characters long)

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 detected1,842 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP253925251,807
CSS17034
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.85
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods96
▷ Static methods1010.42%
▷ Public methods9497.92%
▷ Protected methods11.04%
▷ Private methods11.04%
Functions28
▷ Named functions2692.86%
▷ Anonymous functions27.14%
Constants7
▷ Global constants7100.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
No PNG images were found in this plugin