78% optimize-redis-post-views

Code Review | Redis Post Views

WordPress plugin Redis Post Views scored78%from 54 tests.

About plugin

  • Plugin page: optimize-redis-po...
  • Plugin version: 1.7
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9
  • WordPress version: 6.3.1
  • First release: Jul 27, 2018
  • Latest release: Jul 27, 2018
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: razvanstanga (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /995 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.51ms] Passed 4 tests

A check of server-side resources used by Redis Post Views
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.14 ▼0.03
Dashboard /wp-admin3.38 ▲0.0445.96 ▼11.76
Posts /wp-admin/edit.php3.49 ▲0.1447.22 ▲1.28
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.42 ▼11.54
Media Library /wp-admin/upload.php3.30 ▲0.0740.45 ▲8.75

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Redis Post Views
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9813.78 ▼0.601.84 ▲0.2242.14 ▲1.48
Dashboard /wp-admin2,213 ▲215.47 ▲0.55103.94 ▼1.0866.62 ▲25.20
Posts /wp-admin/edit.php2,111 ▲222.66 ▲0.6341.42 ▲7.7037.32 ▲2.29
Add New Post /wp-admin/post-new.php1,530 ▲1623.80 ▲6.14634.33 ▼47.8937.72 ▼20.82
Media Library /wp-admin/upload.php1,401 ▲164.77 ▲0.47100.54 ▲3.4968.11 ▲25.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/optimize-redis-post-views/post-view.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/optimize-redis-post-views/init.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Redis_Post_Views' not found in wp-content/plugins/optimize-redis-post-views/classes/redis_post_view.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
7 plugin tags: traffic, optimization, caching, performance, redis...

optimize-redis-post-views/init.php 85% from 13 tests

The primary PHP file in "Redis Post Views" version 1.7 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("optimize-redis-post-views.php" instead of "init.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin528 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP548106496
JavaScript301032

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity25.67
▷ Minimum class complexity5.00
▷ Maximum class complexity58.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1990.48%
▷ Protected methods29.52%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png0.99KB1.01KB0.00%