84% sentiment-analysis

Code Review | Sentimental Analysis

WordPress plugin Sentimental Analysis scored84%from 54 tests.

About plugin

  • Plugin page: sentiment-analysis
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2013
  • Latest release: Nov 22, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: ansarkm (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,073 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.86ms] Passed 4 tests

A check of server-side resources used by Sentimental Analysis
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.45 ▲2.63
Dashboard /wp-admin3.38 ▲0.0846.60 ▼11.37
Posts /wp-admin/edit.php3.50 ▲0.1449.22 ▼1.50
Add New Post /wp-admin/post-new.php5.96 ▲0.0796.46 ▲2.80
Media Library /wp-admin/upload.php3.31 ▲0.0739.46 ▲5.20
Sentiments /wp-admin/options-general.php?page=sentiment-analysis3.2739.83

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
sentiment_analysis_options
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sentimental Analysis
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲4813.23 ▼1.421.65 ▼0.3240.65 ▼5.00
Dashboard /wp-admin2,228 ▲375.86 ▼0.0498.29 ▼6.8779.57 ▲37.34
Posts /wp-admin/edit.php2,108 ▲192.00 ▼0.0140.43 ▲0.9837.77 ▲2.54
Add New Post /wp-admin/post-new.php1,693 ▲17524.86 ▲1.64655.95 ▼36.4052.72 ▼9.35
Media Library /wp-admin/upload.php1,401 ▲164.16 ▼0.0496.05 ▼8.3774.87 ▲26.90
Sentiments /wp-admin/options-general.php?page=sentiment-analysis8532.0625.4725.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sentiment-analysis/sentimentanalysis.php:18

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 93% 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
7 plugin tags: sentiment analysis api, text analytics, social sentiment analysis, social data analysis, sentiment analysis...

sentiment-analysis/sentimentanalysis.php 85% from 13 tests

The main file in "Sentimental Analysis" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 275 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sentiment-analysis.php" instead of "sentimentanalysis.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
Success! There were no dangerous files found in this plugin426 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22712426

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.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
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu.png1.55KB0.58KB▼ 62.38%
images/good.png1.51KB0.84KB▼ 44.27%
images/neutral.png1.41KB0.77KB▼ 45.31%
images/bad.png1.44KB0.86KB▼ 40.20%
images/settings.png2.78KB1.59KB▼ 42.69%