10% panda-reviews

Code Review | Panda Reviews

WordPress plugin Panda Reviews scored10%from 54 tests.

About plugin

  • Plugin page: panda-reviews
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Oct 17, 2016
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: pixolette (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,014 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
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/panda-reviews/settings.php+109
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.79MB] [CPU: ▼61.24ms] Passed 4 tests

Server-side resources used by Panda Reviews
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.277.02 ▼39.57
Dashboard /wp-admin2.22 ▼1.096.71 ▼61.00
Posts /wp-admin/edit.php2.22 ▼1.148.46 ▼43.97
Add New Post /wp-admin/post-new.php2.22 ▼3.678.82 ▼100.41
Media Library /wp-admin/upload.php2.22 ▼1.016.72 ▼33.60

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 143 new files
Database: 1 new table, 6 new options
New tables
wp_pxreviews
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Panda Reviews
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲21813.54 ▼1.058.78 ▲6.9637.16 ▼6.81
Dashboard /wp-admin2,220 ▲435.73 ▲0.0491.25 ▼23.1339.56 ▼8.70
Posts /wp-admin/edit.php2,125 ▲222.09 ▲0.1244.57 ▲5.4934.66 ▼4.24
Add New Post /wp-admin/post-new.php1,548 ▲2223.19 ▼0.37661.89 ▲22.8356.93 ▲3.11
Media Library /wp-admin/upload.php1,422 ▲194.29 ▲0.10103.66 ▲0.9643.75 ▼3.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/panda-reviews/settings.php+109
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie tables detected upon uninstall: 1 table
    • wp_pxreviews
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% 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
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/panda-reviews/_views/post-review.php
    • > /wp-content/plugins/panda-reviews/_views/manage-reviews-wpbackend.php
  • 19× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(PXPR_PLUGIN_PATH_models/main-model.php): failed to open stream: No such file or directory in wp-content/plugins/panda-reviews/_controllers/main-controller.php on line 5
    • > PHP Warning
      Use of undefined constant PXPR_PLUGIN_PATH - assumed 'PXPR_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/panda-reviews/_controllers/ajax-requests-controller.php on line 5
    • > PHP Notice
      Undefined variable: reviews_data in wp-content/plugins/panda-reviews/_views/manage-reviews-wpbackend.php on line 31
    • > PHP Fatal error
      require_once(): Failed opening required 'PXPR_PLUGIN_PATH_models/main-model.php' (include_path='.:/usr/share/php') in wp-content/plugins/panda-reviews/_controllers/ajax-requests-controller.php on line 5
    • > PHP Warning
      Use of undefined constant PXPR_PLUGIN_PATH - assumed 'PXPR_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/panda-reviews/_controllers/main-controller.php on line 5
    • > PHP Notice
      Undefined variable: classic_stars in wp-content/plugins/panda-reviews/_views/general-settings-wpbackend.php on line 50
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/panda-reviews/_views/manage-reviews-wpbackend.php on line 3
    • > PHP Warning
      require_once(PXPR_PLUGIN_PATH_models/main-model.php): failed to open stream: No such file or directory in wp-content/plugins/panda-reviews/_controllers/ajax-requests-controller.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/panda-reviews/_views/general-settings-wpbackend.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'PxReviews\\Controller\\PxprMainController' not found in wp-content/plugins/panda-reviews/settings.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: voting system, star rating, wp voting, reviews, star voting...

panda-reviews/base.php 92% from 13 tests

"Panda Reviews" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("panda-reviews.php" instead of "base.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin12,484 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
SVG3005,492
JavaScript76131242,058
CSS7139231,676
PHP124932861,169
Sass511701,008
HTML33510765
Markdown2340300
JSON10016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity39.33
▷ Minimum class complexity33.00
▷ Maximum class complexity51.00
Average method complexity6.75
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods210.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
76 PNG files occupy 0.39MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/rating-schema/icons/like-scheme-5.png1.45KB0.62KB▼ 56.92%
assets/css/images/rating-schema/icons/like-scheme-4.png1.58KB0.79KB▼ 49.75%
assets/css/images/rating-schema/icons/like-scheme-14.png1.33KB0.79KB▼ 40.60%
assets/css/images/rating-schema/icons/like-scheme-2-half-active.png1.73KB0.98KB▼ 43.62%
assets/css/images/rating-schema/icons/default-stars-half-active.png1.11KB0.46KB▼ 58.85%