10% post-rating-and-review

Code Review | Post Rating and Review

WordPress plugin Post Rating and Review scored10%from 54 tests.

About plugin

  • Plugin page: post-rating-and-r...
  • Plugin version: 1.3.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 12, 2022
  • Latest release: Jul 14, 2022
  • Number of updates: 54
  • Update frequency: every 2.8 days
  • Top authors: bourgesloic (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,363 total downloads

Benchmarks

Plugin footprint 23% 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
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+41
    Undefined index: reviews_actif

Server metrics [RAM: ▼1.95MB] [CPU: ▼51.43ms] Passed 4 tests

Analyzing server-side resources used by Post Rating and Review
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.99 ▼34.09
Dashboard /wp-admin2.05 ▼1.257.56 ▼42.74
Posts /wp-admin/edit.php2.05 ▼1.306.87 ▼38.36
Add New Post /wp-admin/post-new.php2.05 ▼3.837.60 ▼90.54
Media Library /wp-admin/upload.php2.05 ▼1.186.80 ▼26.90
Post Rating & Review /wp-admin/options-general.php?page=prar_rating_options2.057.15

Server storage [IO: ▲0.39MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: 1 new table, 6 new options
New tables
wp_prar_ratings_log
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Rating and Review
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲21313.89 ▼0.8611.95 ▲10.3035.78 ▼8.88
Dashboard /wp-admin2,212 ▲215.86 ▼0.0295.14 ▼16.4839.68 ▼5.81
Posts /wp-admin/edit.php2,101 ▲122.07 ▲0.0738.81 ▲1.6434.22 ▼0.43
Add New Post /wp-admin/post-new.php6,215 ▲4,70126.12 ▲8.72908.16 ▲208.2157.84 ▼6.66
Media Library /wp-admin/upload.php1,400 ▲124.22 ▲0.0092.07 ▼10.9240.90 ▼5.79
Post Rating & Review /wp-admin/options-general.php?page=prar_rating_options1,3301.7328.5931.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+41
    Undefined index: reviews_actif
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_prar_ratings_log
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: reviews_actif
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Warning in wp-content/plugins/post-rating-and-review/prar-rating-plugins-compatibility.php+68
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: affichage_note_globale
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: affichage_nombre_notes
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: note_modifiable_apres_vote
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: save_note_dans_post
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+644
    Undefined index: type_champ_dans_post
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+665
    Undefined index: reviews_post_types
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: reviews_rating_obligatoire
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Notice in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php+583
    Undefined index: reviews_comment_obligatoire

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'prar_rating' not found in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-review.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'prar_rating' not found in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-notification.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-rating-and-review/prar-rating-plugins-compatibility.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-rating-and-review/prar-rating-plugins-compatibility.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/post-rating-and-review/includes/template/part-update-review.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-rating-and-review/prar-rating-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'prar_rating' not found in wp-content/plugins/post-rating-and-review/includes/class/class-prar-rating-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/post-rating-and-review/includes/template/post-reviews.php:10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/post-rating-and-review/prar-rating-plugins-compatibility.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=prar_rating_options:162:37)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=prar_rating_options
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

post-rating-and-review/post-rating-and-review.php Passed 13 tests

This is the main PHP file of "Post Rating and Review" version 1.3.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
48 characters long description:
Rating and reviews for your posts & custom posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin4,026 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP102812322,287
PO File2242288856
JavaScript38664556
CSS42616314
SVG20013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity58.80
▷ Minimum class complexity20.00
▷ Maximum class complexity114.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods116
▷ Static methods1311.21%
▷ Public methods11498.28%
▷ Protected methods00.00%
▷ Private methods21.72%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/css/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%
includes/css/images/ui-icons_cc0000_256x240.png4.51KB4.18KB▼ 7.28%
includes/css/images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
includes/css/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%
includes/css/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%