10% hercules-sentiment-analysis

Code Review | Hercules Sentiment Analysis

WordPress plugin Hercules Sentiment Analysis scored10%from 54 tests.

About plugin

  • Plugin page: hercules-sentimen...
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3
  • WordPress version: 6.3.1
  • First release: Jan 24, 2015
  • Latest release: Mar 29, 2016
  • Number of updates: 11
  • Update frequency: every 39.1 days
  • Top authors: toddnestor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /858 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Compile error in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/string/string.php+5
    Cannot use 'String' as class name as it is reserved

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.48ms] Passed 4 tests

Analyzing server-side resources used by Hercules Sentiment Analysis
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.48 ▲2.50
Dashboard /wp-admin3.31 ▼0.0443.15 ▼15.95
Posts /wp-admin/edit.php3.36 ▲0.0044.45 ▼2.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.74 ▼18.83
Media Library /wp-admin/upload.php3.23 ▲0.0033.49 ▼0.32

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 77 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Hercules Sentiment Analysis
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.86 ▲0.601.76 ▲0.1146.71 ▲6.53
Dashboard /wp-admin2,203 ▲115.80 ▲0.8898.92 ▼8.6238.17 ▼6.96
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0536.03 ▼2.9830.40 ▼1.95
Add New Post /wp-admin/post-new.php1,533 ▲1423.21 ▼0.04651.17 ▼8.9760.54 ▲5.12
Media Library /wp-admin/upload.php1,391 ▲34.27 ▲0.0693.76 ▼9.9945.57 ▲0.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/PHPInsight/data/data.neg.php
    • > /wp-content/plugins/hercules-sentiment-analysis/views/settings/template.php
    • > /wp-content/plugins/hercules-sentiment-analysis/views/sentiment-analysis/template.php
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/examples/demo.php
    • > /wp-content/plugins/hercules-sentiment-analysis/plugin.php
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/PHPInsight/data/data.neu.php
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/PHPInsight/data/data.ign.php
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/PHPInsight/data/data.pos.php
    • > /wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/PHPInsight/data/data.prefix.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Hercules\\HercAbstract' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/core/Model.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Handlebars\\Loader' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/handlebars/src/Handlebars/Loader/InlineLoader.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Handlebars\\BaseString' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/handlebars/src/Handlebars/SafeString.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Handlebars\\Helper' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/handlebars/src/Handlebars/Helper/WithHelper.php:39
    • > PHP Fatal error
      Cannot use 'String' as class name as it is reserved in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/string/string.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPInsight_Autoloader' not found in wp-content/plugins/hercules-sentiment-analysis/helpers/phpinsight/src/php-insight/lib/bootstrap.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Hercules\\View' not found in wp-content/plugins/hercules-sentiment-analysis/views/sentiment-analysis/sentiment-analysis.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Hercules\\HercAbstract' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/core/Framework.php:3
    • > PHP Fatal error
      Cannot use Handlebars\\String as String because 'String' is a special class name in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/helpers/handlebars/src/Handlebars/Loader/FilesystemLoader.php on line 27
    • > PHP Fatal error
      Uncaught Error: Class 'Hercules\\HercAbstract' not found in wp-content/plugins/hercules-sentiment-analysis/hercules-framework/core/Controller.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: hercules, comments, sentiment analysis, posts, analysis

hercules-sentiment-analysis/plugin.php 85% from 13 tests

The principal PHP file in "Hercules Sentiment Analysis" v. 1.2.6 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hercules-sentiment-analysis.php" instead of "plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin12,939 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP6268013,55012,911
JSON11020
Markdown1307
CSS1041

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity10.93
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces7
Interfaces3
Traits0
Classes40
▷ Abstract classes12.50%
▷ Concrete classes3997.50%
▷ Final classes00.00%
Methods221
▷ Static methods31.36%
▷ Public methods18483.26%
▷ Protected methods177.69%
▷ Private methods209.05%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants33
▷ Global constants00.00%
▷ Class constants33100.00%
▷ Public constants33100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin