10% protect-my-contents

Code Review | Protect My Contents

WordPress plugin Protect My Contents scored10%from 54 tests.

About plugin

  • Plugin page: protect-my-contents
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 10, 2015
  • Latest release: Nov 11, 2015
  • Number of updates: 17
  • Update frequency: every 0.1 days
  • Top authors: Mik28 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /1,914 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/protect-my-contents/settings.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; prot has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼58.76ms] Passed 4 tests

An overview of server-side resources used by Protect My Contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.12 ▼38.10
Dashboard /wp-admin2.12 ▼1.236.13 ▼56.44
Posts /wp-admin/edit.php2.12 ▼1.245.46 ▼44.64
Add New Post /wp-admin/post-new.php2.12 ▼3.777.34 ▼95.87
Media Library /wp-admin/upload.php2.12 ▼1.115.54 ▼29.10
Protect My Contents /wp-admin/options-general.php?page=prot_options2.126.02

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Protect My Contents
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3813.34 ▼1.213.94 ▲2.0243.23 ▼0.09
Dashboard /wp-admin2,210 ▲224.83 ▼0.04111.49 ▲0.2743.18 ▼0.18
Posts /wp-admin/edit.php2,096 ▲42.04 ▲0.0639.92 ▲3.3635.32 ▼1.12
Add New Post /wp-admin/post-new.php1,545 ▲318.39 ▲0.04618.00 ▼13.2760.61 ▼3.74
Media Library /wp-admin/upload.php1,386 ▼24.21 ▼0.0396.29 ▼8.8443.38 ▼0.09
Protect My Contents /wp-admin/options-general.php?page=prot_options8932.1722.9525.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/protect-my-contents/settings.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; prot has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=prot_options
    • > Deprecated in wp-content/plugins/protect-my-contents/settings.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; prot has a deprecated constructor
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prot_options
    • > Notice in wp-content/plugins/protect-my-contents/settings.php+199
    Trying to access array offset on value of type bool

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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/protect-my-contents/settings.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

protect-my-contents/settings.php 69% from 13 tests

The principal PHP file in "Protect My Contents" v. 2.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("/")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: Prefix the domain path with a forward slash character ("//")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("protect-my-contents.php" instead of "settings.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected226 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15216169
JavaScript12157

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin