80% smart-post-like

Code Review | Smart Post Like

WordPress plugin Smart Post Like scored80%from 54 tests.

About plugin

  • Plugin page: smart-post-like
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Jan 23, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /437 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.96MB] [CPU: ▼40.63ms] Passed 4 tests

A check of server-side resources used by Smart Post Like
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.90 ▼5.95
Dashboard /wp-admin2.99 ▼0.3524.03 ▼43.20
Posts /wp-admin/edit.php2.99 ▼0.3624.44 ▼28.30
Add New Post /wp-admin/post-new.php2.99 ▼2.8923.47 ▼80.15
Media Library /wp-admin/upload.php2.99 ▼0.2324.54 ▼10.85

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Post Like
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15213.45 ▼0.908.27 ▲6.6342.73 ▼2.90
Dashboard /wp-admin2,211 ▲345.63 ▼0.0294.79 ▲6.1344.57 ▲0.61
Posts /wp-admin/edit.php2,116 ▲161.97 ▼0.0435.11 ▼4.1134.76 ▼3.18
Add New Post /wp-admin/post-new.php1,539 ▲1323.38 ▲0.23668.33 ▼9.2959.81 ▲3.72
Media Library /wp-admin/upload.php1,416 ▲134.18 ▼0.0098.24 ▼3.3544.40 ▲1.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: like, post, post like

smart-post-like/main.php 92% from 13 tests

The main PHP file in "Smart Post Like" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("smart-post-like.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin182 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2221998
CSS110161
JavaScript15523

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/like.png27.13KB10.27KB▼ 62.14%
images/like-icon-light.png4.25KB1.94KB▼ 54.30%
images/like-icon-tp.png17.70KB6.79KB▼ 61.66%
images/star.png1.31KB1.45KB0.00%
images/like-icon-dark.png4.31KB1.94KB▼ 54.91%