84% wp-post-rating

Code Review | Wp Post Rating

WordPress plugin Wp Post Rating scored 84% from 54 tests.

About plugin

  • Plugin page: wp-post-rating
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-5.7.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2018
  • Latest release: Jul 18, 2021
  • Number of updates: 47
  • Update frequency: every 21.0 days
  • Top authors: Shmidtelson (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.84MB] [CPU: ▲2.68ms] Passed 4 tests

Server-side resources used by Wp Post Rating
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.8341.31 ▲4.57
Dashboard /wp-admin4.15 ▲0.8552.16 ▲4.80
Posts /wp-admin/edit.php4.20 ▲0.8460.92 ▲12.60
Add New Post /wp-admin/post-new.php6.74 ▲0.8692.04 ▼4.64
Media Library /wp-admin/upload.php4.07 ▲0.8444.84 ▲5.97
WPR Settings /wp-admin/admin.php?page=wpr-settings4.3942.10
Stars rating /wp-admin/options-general.php?page=wp-post-rating4.2040.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,091 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
wpr_settings
widget_recent-comments
widget_wpr_widget
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Wp Post Rating: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲15813.98 ▼0.609.67 ▲7.6737.17 ▼9.53
Dashboard /wp-admin2,212 ▲304.89 ▼0.97131.70 ▲29.3554.25 ▲7.03
Posts /wp-admin/edit.php2,092 ▼02.02 ▼0.0139.97 ▼1.4437.36 ▲2.48
Add New Post /wp-admin/post-new.php1,518 ▲417.57 ▲0.08676.35 ▼15.1259.65 ▲7.58
Media Library /wp-admin/upload.php1,388 ▼34.18 ▼0.13102.02 ▼5.6547.98 ▲5.58
WPR Settings /wp-admin/admin.php?page=wpr-settings9622.0327.6926.90
Stars rating /wp-admin/options-general.php?page=wp-post-rating9832.0623.8830.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • wpr_settings
    • widget_wpr_widget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 616× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Sandbox\\SecurityError' not found in wp-content/plugins/wp-post-rating/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'WPR_Vendor\\Twig\\RuntimeLoader\\RuntimeLoaderInterface' not found in wp-content/plugins/wp-post-rating/vendor_prefixed/twig/RuntimeLoader/ContainerRuntimeLoader.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WPR_Vendor\\Twig\ode\\Expression\\ConditionalExpression' not found in wp-content/plugins/wp-post-rating/vendor_prefixed/twig/Node/Expression/NullCoalesceExpression.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\odeVisitor\odeVisitorInterface' not found in wp-content/plugins/wp-post-rating/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'WPR_Vendor\\Symfony\\Component\\Config\\Resource\\SelfCheckingResourceInterface' not found in wp-content/plugins/wp-post-rating/vendor_prefixed/symfony_config/Resource/ReflectionClassResource.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Config\\Resource\\ResourceInterface' not found in wp-content/plugins/wp-post-rating/vendor/symfony/dependency-injection/Config/ContainerParametersResource.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Error\\Error' not found in wp-content/plugins/wp-post-rating/vendor/twig/twig/src/Error/SyntaxError.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Config\\Definition\\Builder\odeDefinition' not found in wp-content/plugins/wp-post-rating/vendor/symfony/config/Definition/Builder/VariableNodeDefinition.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'WPR_Vendor\\Symfony\\Component\\Config\\ResourceCheckerInterface' not found in wp-content/plugins/wp-post-rating/vendor_prefixed/symfony_container/dependency-injection/Config/ContainerParametersResourceChecker.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-post-rating/src/Wordpress/WPR_Widget.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: google rating, rating, seo rating, postrating, ratings...

wp-post-rating/wp-post-rating.php Passed 13 tests

"Wp Post Rating" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
37 characters long description:
Powerful post rating wordpress plugin

Code Analysis 97% from 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 detected63,975 lines of code in 1,055 files:
LanguageFilesBlank linesComment linesLines of code
PHP9138,42924,11858,987
reStructuredText1122,3762,3032,872
JSON100835
Markdown41060369
XSD1292299
JavaScript6220196
Twig1130174
PO File14344124
Bourne Shell16143
YAML17439
HTML11021
SVG12014
CSS2002

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 109)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity11.60
▷ Minimum class complexity1.00
▷ Maximum class complexity560.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity109.00
Code structure
Namespaces121
Interfaces102
Traits50
Classes749
▷ Abstract classes466.14%
▷ Concrete classes70393.86%
▷ Final classes13318.92%
Methods3,924
▷ Static methods1584.03%
▷ Public methods3,14980.25%
▷ Protected methods2797.11%
▷ Private methods49612.64%
Functions342
▷ Named functions18052.63%
▷ Anonymous functions16247.37%
Constants190
▷ Global constants52.63%
▷ Class constants18597.37%
▷ Public constants17996.76%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin