94% gamipress-restrict-content-pro-integration

Code Review | GamiPress - Restrict Content Pro integration

WordPress plugin GamiPress - Restrict Content Pro integration scored 94% from 54 tests.

About plugin

  • Plugin page: gamipress-restric...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: Jun 19, 2020
  • Latest release: Jan 24, 2022
  • Number of updates: 9
  • Update frequency: every 64.9 days
  • Top authors: rubengc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 626 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by GamiPress - Restrict Content Pro integration
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0153.42 ▼0.15
Dashboard /wp-admin3.41 ▲0.0133.05 ▼1.47
Posts /wp-admin/edit.php3.65 ▲0.0138.15 ▲0.02
Add New Post /wp-admin/post-new.php6.89 ▼0.0897.28 ▼1,159.07
Media Library /wp-admin/upload.php3.30 ▼0.0025.51 ▼6.10

Server storage [IO: ▲0.02MB] [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: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

GamiPress - Restrict Content Pro integration: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,823 ▲6915.98 ▲0.396.23 ▼0.202.67 ▲0.14
Dashboard /wp-admin2,916 ▲586.12 ▼0.18117.64 ▼21.14154.88 ▼4.96
Posts /wp-admin/edit.php2,716 ▲253.24 ▲0.0164.21 ▲1.05140.82 ▲2.28
Add New Post /wp-admin/post-new.php1,725 ▲1420.77 ▼0.59421.19 ▼61.72153.58 ▼8.83
Media Library /wp-admin/upload.php1,723 ▲225.51 ▼0.00137.03 ▼5.52188.61 ▼1.01

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
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gamipress-restrict-content-pro-integration/gamipress-restrict-content-pro.php:217

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: member, gamipress, memberships, restrict content, members...

gamipress-restrict-content-pro-integration/gamipress-restrict-content-pro.php 92% from 13 tests

The main PHP file in "GamiPress - Restrict Content Pro integration" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gamipress-restrict-content-pro-integration.php" instead of "gamipress-restrict-content-pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin256 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5116270256

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods9
▷ Static methods111.11%
▷ Public methods555.56%
▷ Protected methods00.00%
▷ Private methods444.44%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin