68% aweos-wp-lock

Code Review | AWEOS WP Lock

WordPress plugin AWEOS WP Lock scored68%from 54 tests.

About plugin

  • Plugin page: aweos-wp-lock
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 10, 2016
  • Latest release: Oct 13, 2023
  • Number of updates: 64
  • Update frequency: every 40.0 days
  • Top authors: aweos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /7,272 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼2.79ms] Passed 4 tests

Server-side resources used by AWEOS WP Lock
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2640.42 ▼0.83
Dashboard /wp-admin3.56 ▲0.2547.00 ▼3.76
Posts /wp-admin/edit.php3.61 ▲0.2549.87 ▲1.81
Add New Post /wp-admin/post-new.php6.09 ▲0.2092.68 ▼8.39
Media Library /wp-admin/upload.php3.42 ▲0.1839.18 ▲6.04

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 2,022 new files
Database: no new tables, 14 new options
New WordPress options
can_compress_scripts
wpLockTo
wpLockFor
wpLockUntil
wpLockMode
wpLockMessage
wpLockForI
widget_theysaidso_widget
wpLockUpdated
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by AWEOS WP Lock
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11814.21 ▼0.374.44 ▲2.9236.75 ▼2.38
Dashboard /wp-admin2,243 ▲685.90 ▲0.1996.49 ▼12.9139.25 ▼0.16
Posts /wp-admin/edit.php2,154 ▲512.84 ▲0.8446.97 ▲2.8836.85 ▲2.68
Add New Post /wp-admin/post-new.php1,551 ▲1423.87 ▲5.56641.47 ▲25.0135.04 ▼33.94
Media Library /wp-admin/upload.php1,454 ▲605.33 ▲1.09104.85 ▲2.3443.32 ▼1.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 14 options
    • wpLockFrom
    • wpLockMessage
    • wpLockForI
    • wpLockTo
    • can_compress_scripts
    • wpLockUntil
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • wpLockFor
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/aweos-wp-lock/vendor/symfony/translation/Resources/bin/translation-status.php
  • 158× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/aweos-wp-lock/vendor/symfony/translation/Tests/Dumper/IniFileDumperTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/aweos-wp-lock/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\PHPStan\\AbstractMacro' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\PHPStan\\AbstractMacro' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\BadMethodCallException' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\CarbonInterface' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/src/Carbon/Carbon.php:510
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/aweos-wp-lock/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Tests\\Loader\\LocalizedTestCase' not found in wp-content/plugins/aweos-wp-lock/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\RuntimeException' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\PHPStan\\AbstractReflectionMacro' not found in wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed: The official readme.txt might help

aweos-wp-lock/aweos-wp-lock.php Passed 13 tests

The main PHP script in "AWEOS WP Lock" version 1.2.2 is automatically included on every request by WordPress
59 characters long description:
This Plugin displays a coming soon page in development mode

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/aweos-wp-lock/vendor/nesbot/carbon/bin/carbon.bat
197,272 lines of code in 1,711 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript67718,50623,518141,128
PHP8727,32225,90237,852
Markdown542,56307,070
JSON58005,312
XSD499764,991
TypeScript18499377
XML1530319
YAML1756107
CSS25057
PO File67037
Qt Linguist10010
Bourne Shell2017
DOS Batch1004
INI1001

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.42
▷ Minimum class complexity1.00
▷ Maximum class complexity351.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces35
Interfaces26
Traits27
Classes173
▷ Abstract classes148.09%
▷ Concrete classes15991.91%
▷ Final classes95.66%
Methods1,806
▷ Static methods38621.37%
▷ Public methods1,55986.32%
▷ Protected methods1226.76%
▷ Private methods1256.92%
Functions296
▷ Named functions6220.95%
▷ Anonymous functions23479.05%
Constants99
▷ Global constants44.04%
▷ Class constants9595.96%
▷ Public constants9498.95%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image/aweos-partner.png5.63KB2.12KB▼ 62.37%