83% swpm-elementor-template-protection

Code Review | SWPM - Elementor Template Protection

WordPress plugin SWPM - Elementor Template Protection scored83%from 54 tests.

About plugin

  • Plugin page: swpm-elementor-te...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Aug 19, 2021
  • Latest release: Aug 19, 2021
  • Number of updates: 2
  • Update frequency: every 4.5 days
  • Top authors: svilappsrl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,802 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼2.41ms] Passed 4 tests

Server-side resources used by SWPM - Elementor Template Protection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.43 ▼2.47
Dashboard /wp-admin3.31 ▲0.0143.13 ▼1.99
Posts /wp-admin/edit.php3.36 ▲0.0144.55 ▼4.17
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.44 ▼1.00
Media Library /wp-admin/upload.php3.23 ▲0.0034.35 ▲3.71

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

SWPM - Elementor Template Protection: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.25 ▼1.041.75 ▼0.0144.78 ▲7.26
Dashboard /wp-admin2,218 ▲325.81 ▲0.8895.36 ▼19.2442.61 ▲2.72
Posts /wp-admin/edit.php2,106 ▲172.00 ▼0.0442.52 ▲5.9040.80 ▲6.17
Add New Post /wp-admin/post-new.php1,549 ▲1623.40 ▲0.14595.81 ▲1.5351.22 ▲2.46
Media Library /wp-admin/upload.php1,406 ▲214.34 ▲0.17100.57 ▲4.1444.24 ▼2.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/swpm-elementor-template-protection/includes/widgets/ElementorSimpleMembershipWidget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swpm-elementor-template-protection/includes/ElementorSimpleMembershipExtension.php:65

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

swpm-elementor-template-protection/plugin.php 85% from 13 tests

The entry point to "SWPM - Elementor Template Protection" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("swpm-elementor-template-protection.php" instead of "plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 167 characters long)

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
There were no executable files found in this plugin267 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP485205267

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.00
▷ Minimum class complexity6.00
▷ Maximum class complexity12.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods23
▷ Static methods521.74%
▷ Public methods2191.30%
▷ Protected methods28.70%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin