84% ctc-rating

Code Review | CTC Rating

WordPress plugin CTC Rating scored 84% from 54 tests.

About plugin

  • Plugin page: ctc-rating
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 16, 2020
  • Latest release: Jul 16, 2023
  • Number of updates: 13
  • Update frequency: every 79.5 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 923 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▲0.96ms] Passed 4 tests

Analyzing server-side resources used by CTC Rating
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.52 ▲3.39
Dashboard /wp-admin3.33 ▲0.0248.18 ▲4.57
Posts /wp-admin/edit.php3.38 ▲0.0243.40 ▼5.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.65 ▲0.92
Media Library /wp-admin/upload.php3.25 ▲0.0240.37 ▲5.43

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for CTC Rating
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲3213.26 ▼1.601.85 ▲0.1443.35 ▲0.77
Dashboard /wp-admin2,216 ▲104.87 ▼0.98112.86 ▲7.7842.11 ▲3.13
Posts /wp-admin/edit.php2,096 ▲102.03 ▼0.0033.86 ▼1.9832.56 ▼1.96
Add New Post /wp-admin/post-new.php1,568 ▲3523.96 ▲0.79638.35 ▼30.6930.46 ▼23.17
Media Library /wp-admin/upload.php1,398 ▲104.18 ▼0.0392.63 ▼15.0143.73 ▼5.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ctc-rating/ctc-rating.php:17

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Rating on frontend), #2 (Gutenberg block), #3 (Users who Liked in modal)
You can take inspiration from this readme.txt

ctc-rating/ctc-rating.php Passed 13 tests

The main PHP script in "CTC Rating" version 1.6.0 is automatically included on every request by WordPress
50 characters long description:
Thumb up and thumb down rating for WordPress post

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 plugin16,821 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON40016,106
JavaScript627104292
Sass2470250
PHP38167171
CSS2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.13MB with 0.10MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.64KB6.21KB▼ 68.37%
screenshot-2.png65.82KB16.94KB▼ 74.25%
screenshot-3.png51.59KB13.28KB▼ 74.26%