78% hatemile-for-wp

Code Review | HaTeMiLe for WP

WordPress plugin HaTeMiLe for WP scored78%from 54 tests.

About plugin

  • Plugin page: hatemile-for-wp
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Sep 17, 2015
  • Latest release: May 15, 2018
  • Number of updates: 5
  • Update frequency: every 194.2 days
  • Top authors: carlsonsantana (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /681 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.68ms] Passed 4 tests

A check of server-side resources used by HaTeMiLe for WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3417.77 ▼24.04
Dashboard /wp-admin3.36 ▲0.0645.89 ▼2.19
Posts /wp-admin/edit.php3.41 ▲0.0545.87 ▲1.33
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.82 ▲8.43
Media Library /wp-admin/upload.php3.28 ▲0.0536.63 ▲6.19
HaTeMiLe for WP /wp-admin/options-general.php?page=hatemile-settings3.2532.81

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 165 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for HaTeMiLe for WP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,038 ▲26713.70 ▼0.672.37 ▲0.2141.07 ▼3.20
Dashboard /wp-admin2,213 ▲255.77 ▼0.1498.85 ▼17.6738.96 ▼4.39
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0739.59 ▲1.0534.61 ▲0.59
Add New Post /wp-admin/post-new.php1,523 ▼622.78 ▼0.40598.09 ▼75.2757.40 ▲5.73
Media Library /wp-admin/upload.php1,392 ▲74.19 ▲0.0096.52 ▼3.8046.89 ▲6.21
HaTeMiLe for WP /wp-admin/options-general.php?page=hatemile-settings8812.1823.1028.11

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hatemile-for-wp/phpQuery/demo.php
  • 130× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/Hostname.php on line 27
    • > PHP Warning
      require_once(Zend/Validate/Hostname/Interface.php): failed to open stream: No such file or directory in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/Hostname/Li.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to a member function find() on null in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/plugins/Scripts/print_websafe.php:10
    • > PHP Warning
      require_once(Zend/Exception.php): failed to open stream: No such file or directory in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Http/Exception.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hatemile-for-wp/execute_hatemile.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/Hostname/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/Hostname/Hu.php on line 27
    • > PHP Warning
      require_once(Zend/Validate/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/Digits.php on line 27
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Validate/File/Size.php' (include_path='.:/usr/share/php') in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/File/FilesSize.php on line 25
    • > PHP Fatal error
      require_once(): Failed opening required 'Zend/Http/Exception.php' (include_path='.:/usr/share/php') in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Http/Client/Exception.php on line 23
    • > PHP Warning
      require_once(Zend/Validate/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/hatemile-for-wp/phpQuery/phpQuery/phpQuery/Zend/Validate/Date.php on line 27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
5 plugin tags: wai-aria, accessibility, screen reader, wcag, assistive technology

hatemile-for-wp/hatemile_for_wp.php 92% from 13 tests

Analyzing the main PHP file in "HaTeMiLe for WP" version 1.1
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hatemile-for-wp.php" instead of "hatemile_for_wp.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 detected32,074 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP1162,11410,01314,361
HTML221,299014,088
JavaScript76464902,700
JSON200414
Markdown51060274
CSS2322191
XML20046

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity22.09
▷ Minimum class complexity1.00
▷ Maximum class complexity558.00
Average method complexity4.05
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces8
Interfaces17
Traits0
Classes95
▷ Abstract classes99.47%
▷ Concrete classes8690.53%
▷ Final classes00.00%
Methods884
▷ Static methods14716.63%
▷ Public methods72982.47%
▷ Protected methods14816.74%
▷ Private methods70.79%
Functions26
▷ Named functions2284.62%
▷ Anonymous functions415.38%
Constants168
▷ Global constants42.38%
▷ Class constants16497.62%
▷ Public constants164100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
phpQuery/api-reference/media/empty.png0.20KB0.09KB▼ 53.88%
phpQuery/api-reference/media/background.png0.23KB0.10KB▼ 58.82%