78% rating-add

Code Review | Rating

WordPress plugin Rating scored78%from 54 tests.

About plugin

  • Plugin page: rating-add
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.8
  • WordPress version: 6.3.1
  • First release: May 10, 2016
  • Latest release: Sep 11, 2016
  • Number of updates: 11
  • Update frequency: every 48.3 days
  • Top authors: umarbajwa (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /4,846 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Rating
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.42 ▲2.33
Dashboard /wp-admin3.40 ▲0.0549.43 ▼17.15
Posts /wp-admin/edit.php3.45 ▲0.0950.40 ▼1.74
Add New Post /wp-admin/post-new.php5.98 ▲0.0992.77 ▼23.82
Media Library /wp-admin/upload.php3.33 ▲0.0940.15 ▲4.08
Add New Rating /wp-admin/post-new.php?post_type=wsrp_rating3.4245.82
Ratings /wp-admin/edit.php?post_type=wsrp_rating3.3741.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Rating
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16713.40 ▼0.939.88 ▲8.2245.91 ▲3.93
Dashboard /wp-admin2,223 ▲465.72 ▲0.0994.51 ▲4.6287.19 ▲44.61
Posts /wp-admin/edit.php2,134 ▲312.02 ▼0.1139.26 ▼6.1335.51 ▼0.05
Add New Post /wp-admin/post-new.php1,552 ▲2422.99 ▲0.03672.41 ▲15.68179.96 ▲113.78
Media Library /wp-admin/upload.php1,428 ▲254.15 ▼0.01110.27 ▼1.5478.92 ▲34.46
Add New Rating /wp-admin/post-new.php?post_type=wsrp_rating2,2543.3675.73103.11
Ratings /wp-admin/edit.php?post_type=wsrp_rating1,1072.2438.1729.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/rating-add/UI/wsrp_user_interface.php:1
    • > PHP Warning
      Use of undefined constant WSRP_PLUGIN_PATH - assumed 'WSRP_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rating-add/inc/includes.php on line 3
    • > PHP Warning
      include(WSRP_PLUGIN_PATH/init/wsrp_init_class.php): failed to open stream: No such file or directory in wp-content/plugins/rating-add/inc/includes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rating-add/config.php:4
    • > PHP Warning
      include(): Failed opening 'WSRP_PLUGIN_PATH/init/wsrp_init_class.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/rating-add/inc/includes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/rating-add/templates/template-1.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WSRP_Init_Class' not found in wp-content/plugins/rating-add/inc/includes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rating-add/config.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=wsrp_rating
    • > Network (severe)
    wp-content/plugins/rating-add/img/template1.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Rating Demo), #2 (Rating Demo), #3 (Rating Demo), #4 (Rating Demo), #5 (Rating Demo)
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt might help

rating-add/index.php 92% from 13 tests

This is the main PHP file of "Rating" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("rating-add.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
There were no executable files found in this plugin1,231 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP618827650
JavaScript26165483
CSS111098

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity47.00
▷ Minimum class complexity47.00
▷ Maximum class complexity47.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
9 PNG files occupy 0.20MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/template2.png36.88KB8.56KB▼ 76.78%
img/template4.png30.68KB6.43KB▼ 79.04%
img/star-icon.png0.71KB0.61KB▼ 14.50%
img/template6.png24.64KB4.69KB▼ 80.96%
img/template3.png32.86KB7.59KB▼ 76.90%