84% simple-like-dislike-posts

Code Review | Simple Like Dislike Posts

WordPress plugin Simple Like Dislike Posts scored84%from 54 tests.

About plugin

  • Plugin page: simple-like-disli...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Sep 13, 2017
  • Latest release: Nov 23, 2017
  • Number of updates: 4
  • Update frequency: every 18.0 days
  • Top authors: piyush.rawat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /952 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by Simple Like Dislike Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.65 ▼0.33
Dashboard /wp-admin3.38 ▲0.0851.22 ▼6.54
Posts /wp-admin/edit.php3.43 ▲0.0752.51 ▼1.96
Add New Post /wp-admin/post-new.php5.98 ▲0.0994.37 ▼3.66
Media Library /wp-admin/upload.php3.30 ▲0.0749.19 ▲13.06

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 17 new files
Database: 1 new table, 7 new options
New tables
wp_simplelikecounter
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_sal_most_liked_posts_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Simple Like Dislike Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18913.70 ▼0.707.08 ▲4.9541.08 ▼4.26
Dashboard /wp-admin2,231 ▲435.93 ▲1.05109.53 ▼9.9242.66 ▼0.60
Posts /wp-admin/edit.php2,111 ▲222.04 ▼0.0141.67 ▲4.9934.75 ▲2.92
Add New Post /wp-admin/post-new.php1,533 ▲1923.31 ▲5.66682.31 ▼8.4751.68 ▲0.34
Media Library /wp-admin/upload.php1,404 ▲134.18 ▼0.13110.54 ▲7.3245.64 ▼1.81

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_sal_most_liked_posts_widget
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-like-dislike-posts/simple-like-dislike-posts.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-like-dislike-posts/functions.php:88
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-like-dislike-posts/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The plugin page where you can configure options)
The official readme.txt might help

simple-like-dislike-posts/simple-like-dislike-posts.php Passed 13 tests

The entry point to "Simple Like Dislike Posts" version 1.0 is a PHP file that has certain tags in its header comment area
67 characters long description:
A simple plugin to appy AJAX like and dislike feature in your posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin3,327 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
PHP53414491
JavaScript26189
CSS20476

PHP code Passed 2 tests

An overview 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.24
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png145.08KB50.32KB▼ 65.31%