10% cool-like-dislike

Code Review | Cool Like - DisLike

WordPress plugin Cool Like - DisLike scored10%from 54 tests.

About plugin

  • Plugin page: cool-like-dislike
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2016
  • Latest release: Jul 30, 2016
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: kotlyarov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,000 total downloads

Benchmarks

Plugin footprint 40% 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
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/cool-like-dislike/index.php+114
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼58.81ms] Passed 4 tests

Server-side resources used by Cool Like - DisLike
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.33 ▼38.09
Dashboard /wp-admin2.05 ▼1.266.02 ▼49.14
Posts /wp-admin/edit.php2.05 ▼1.315.87 ▼49.86
Add New Post /wp-admin/post-new.php2.05 ▼3.844.95 ▼98.15
Media Library /wp-admin/upload.php2.05 ▼1.185.02 ▼35.90

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: 1 new table, 7 new options
New tables
wp_likedislike
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_widget_likedislikewidget

Browser metrics Passed 4 tests

Cool Like - DisLike: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.23 ▲0.291.99 ▲0.4439.56 ▼0.33
Dashboard /wp-admin2,192 ▲155.62 ▲0.0891.59 ▼10.2138.94 ▼0.05
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0542.17 ▼2.8735.01 ▼0.09
Add New Post /wp-admin/post-new.php1,526 ▼023.10 ▲0.45638.21 ▼46.5055.49 ▲2.05
Media Library /wp-admin/upload.php1,391 ▼34.16 ▼0.0797.65 ▼19.2141.51 ▼8.23

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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/cool-like-dislike/index.php+114
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_widget_likedislikewidget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cool-like-dislike/index.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cool-like-dislike/widgets/likedislike.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Внешний вид плагина) image not found
Please take inspiration from this readme.txt

cool-like-dislike/index.php 92% from 13 tests

The main PHP file in "Cool Like - DisLike" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cool-like-dislike.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected219 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23719208
Markdown1206
SQL1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png4.20KB2.30KB▼ 45.30%