74% unmask

Code Review | Unmask

WordPress plugin Unmask scored74%from 54 tests.

About plugin

  • Plugin page: unmask
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-4.9.2
  • WordPress version: 6.3.1
  • First release: Jan 31, 2018
  • Latest release: Jan 31, 2018
  • Number of updates: 2
  • Update frequency: every 4.5 days
  • Top authors: ericmann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.28MB] [CPU: ▲0.95ms] Passed 4 tests

This is a short check of server-side resources used by Unmask
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3042.03 ▼1.10
Dashboard /wp-admin3.60 ▲0.2953.26 ▲3.70
Posts /wp-admin/edit.php3.65 ▲0.2956.05 ▲5.39
Add New Post /wp-admin/post-new.php6.12 ▲0.2399.10 ▲6.37
Media Library /wp-admin/upload.php3.52 ▲0.2938.63 ▼4.20
Unmask Logs /wp-admin/edit.php?post_type=unmask_log3.6146.55

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,468 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Unmask
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.35 ▼1.291.62 ▼0.4442.15 ▼2.29
Dashboard /wp-admin2,207 ▲165.84 ▲0.9398.78 ▼7.4442.52 ▲6.01
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0140.91 ▼0.0437.00 ▼0.10
Add New Post /wp-admin/post-new.php1,531 ▲1721.07 ▲3.30723.44 ▲26.9655.69 ▼4.31
Media Library /wp-admin/upload.php1,386 ▼24.22 ▼0.11103.32 ▲3.1244.04 ▼3.18
Unmask Logs /wp-admin/edit.php?post_type=unmask_log1,6231.9934.5530.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 517× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/unmask/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/unmask/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Expose\\Export' not found in wp-content/plugins/unmask/vendor/enygma/expose/src/Expose/Export/Loopback.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/unmask/vendor/monolog/monolog/tests/Monolog/LoggerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Sandbox_SecurityError' not found in wp-content/plugins/unmask/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/unmask/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_BaseNodeVisitor' not found in wp-content/plugins/unmask/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/unmask/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Descriptor\\Descriptor' not found in wp-content/plugins/unmask/vendor/symfony/console/Descriptor/MarkdownDescriptor.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/unmask/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 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
3 plugin tags: intrusion detection, security, logging

unmask/unmask.php Passed 13 tests

The main PHP file in "Unmask" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
28 characters long description:
Expose support for WordPress

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/unmask/vendor/symfony/console/Resources/bin/hiddeninput.exe
    • .bat - Batch File in Windows
      • wp-content/plugins/unmask/vendor/enygma/expose/docs/make.bat
62,985 lines of code in 1,099 files:
LanguageFilesBlank linesComment linesLines of code
PHP86711,58119,03151,870
reStructuredText892,0841,9222,711
JSON33102,605
Markdown3972101,807
JavaScript71703181,372
CSS421251812
XML28360626
HTML14490425
C1528223
DOS Batch1291212
make1286143
m41111141
C/C++ Header112840
Twig99033
Python16915432
YAML26132
INI1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.26
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces83
Interfaces48
Traits5
Classes836
▷ Abstract classes323.83%
▷ Concrete classes80496.17%
▷ Final classes536.59%
Methods4,031
▷ Static methods1373.40%
▷ Public methods3,35683.25%
▷ Protected methods40710.10%
▷ Private methods2686.65%
Functions329
▷ Named functions11133.74%
▷ Anonymous functions21866.26%
Constants136
▷ Global constants75.15%
▷ Class constants12994.85%
▷ Public constants129100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/enygma/expose/docs/_build/html/_static/up-pressed.png0.36KB0.31KB▼ 14.25%
vendor/enygma/expose/docs/_build/html/_static/minus.png0.19KB0.11KB▼ 44.72%
vendor/enygma/expose/docs/_build/html/_static/comment.png3.36KB0.75KB▼ 77.62%
vendor/enygma/expose/docs/_build/html/_static/up.png0.35KB0.31KB▼ 12.12%
vendor/enygma/expose/docs/_build/html/_static/comment-bright.png3.42KB0.86KB▼ 74.97%