10% floating-related-posts-by-views-or-publish-date

Code Review | Floating Related Posts by Views or Publish Date

WordPress plugin Floating Related Posts by Views or Publish Date scored10%from 54 tests.

About plugin

  • Plugin page: floating-related-...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6 or later+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 27, 2023
  • Latest release: Aug 16, 2023
  • Number of updates: 64
  • Update frequency: every 3.2 days
  • Top authors: antoniolamorgese (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /753 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/floating-related-posts-by-views-or-publish-date/admin/floating-related-posts-by-views-or-date-admin.php+21
    Undefined variable: addDefaultValues

Server metrics [RAM: ▼1.76MB] [CPU: ▼50.40ms] Passed 4 tests

Analyzing server-side resources used by Floating Related Posts by Views or Publish Date
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0333.97 ▼2.45
Dashboard /wp-admin2.20 ▼1.1513.02 ▼47.83
Posts /wp-admin/edit.php2.20 ▼1.167.32 ▼41.48
Add New Post /wp-admin/post-new.php2.20 ▼3.698.86 ▼87.69
Media Library /wp-admin/upload.php2.20 ▼1.038.47 ▼24.58
Floating Related Posts by Views or Date /wp-admin/options-general.php?page=floating-related-posts-by-views-or-date2.208.05

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

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

Browser metrics Passed 4 tests

Floating Related Posts by Views or Publish Date: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲4814.25 ▼0.341.86 ▲0.1140.88 ▼1.42
Dashboard /wp-admin2,199 ▲195.52 ▼0.1181.38 ▼3.4039.05 ▲0.37
Posts /wp-admin/edit.php2,104 ▲41.98 ▲0.0138.63 ▲5.4736.55 ▲2.48
Add New Post /wp-admin/post-new.php1,538 ▲1018.66 ▼4.67629.51 ▼41.1365.69 ▲11.68
Media Library /wp-admin/upload.php1,407 ▲74.17 ▲0.0191.66 ▼5.7241.04 ▼3.82
Floating Related Posts by Views or Date /wp-admin/options-general.php?page=floating-related-posts-by-views-or-date1,0362.0023.4727.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/floating-related-posts-by-views-or-publish-date/admin/floating-related-posts-by-views-or-date-admin.php+21
    Undefined variable: addDefaultValues
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=floating-related-posts-by-views-or-date
    • > Notice in wp-content/plugins/floating-related-posts-by-views-or-publish-date/admin/floating-related-posts-by-views-or-date-admin.php+240
    Undefined variable: addDefaultValues
    • > GET request to /wp-admin/options-general.php?page=floating-related-posts-by-views-or-date
    • > Notice in wp-content/plugins/floating-related-posts-by-views-or-publish-date/admin/floating-related-posts-by-views-or-date-admin.php+22
    Undefined variable: dirPathPlugin
    • > GET request to /wp-admin/options-general.php?page=floating-related-posts-by-views-or-date
    • > Notice in wp-content/plugins/floating-related-posts-by-views-or-publish-date/admin/floating-related-posts-by-views-or-date-admin.php+22
    Undefined variable: DirPlugin

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
No output text or server-side errors detected on direct access of PHP files

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 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: related posts, free related posts, floating related posts, related, floating...

floating-related-posts-by-views-or-publish-date/floating-related-posts-by-views-or-date.php 69% from 13 tests

The main PHP file in "Floating Related Posts by Views or Publish Date" ver. 1.2.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires PHP: Periods and digits should be used for the required version number (ex. "7.0" instead of "5.6 or later")
  • Requires at least: Required version must match the one declared in readme.txt ("5.3" instead of "5.6")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("floating-related-posts-by-views-or-publish-date.php" instead of "floating-related-posts-by-views-or-date.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 291 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,167 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP475215651
PO File5200210515
CSS1031

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity59.00
▷ Minimum class complexity59.00
▷ Maximum class complexity59.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.86MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png77.64KB82.47KB0.00%
assets/screenshot-1.png105.12KB67.81KB▼ 35.49%
assets/screenshot-2.png16.00KB15.72KB▼ 1.71%
assets/icon-128x128.png40.37KB9.02KB▼ 77.66%
admin/assets/background-colors-popup.png65.85KB12.52KB▼ 80.98%