78% flexible-recent-posts

Code Review | Flexible Recent Posts

WordPress plugin Flexible Recent Posts scored78%from 54 tests.

About plugin

  • Plugin page: flexible-recent-p...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Apr 18, 2012
  • Latest release: Oct 18, 2015
  • Number of updates: 72
  • Update frequency: every 17.8 days
  • Top authors: TheSteelRat (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /21,789 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.07ms] Passed 4 tests

Server-side resources used by Flexible Recent Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.24 ▼2.49
Dashboard /wp-admin3.38 ▲0.0746.10 ▼5.31
Posts /wp-admin/edit.php3.49 ▲0.1351.28 ▲2.63
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.11 ▼16.85
Media Library /wp-admin/upload.php3.30 ▲0.0735.30 ▲0.39

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_flexible-recent-posts-widget
theysaidso_admin_options
frp_data
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Flexible Recent Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼1.041.64 ▼0.3642.13 ▼4.28
Dashboard /wp-admin2,203 ▲154.87 ▼0.02111.57 ▼9.0741.44 ▼1.84
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0339.79 ▲1.4335.36 ▲4.24
Add New Post /wp-admin/post-new.php1,533 ▲1923.06 ▲5.49648.65 ▼32.9567.93 ▲12.40
Media Library /wp-admin/upload.php1,388 ▼34.15 ▼0.0695.48 ▼6.8740.99 ▼4.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • frp_data
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_flexible-recent-posts-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/flexible-recent-posts/themes/default/template.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/flexible-recent-posts/templates/recent-posts-widget.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flexible-recent-posts/flexible-recent-posts.php:27
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/flexible-recent-posts/templates/recent-posts-widget.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/flexible-recent-posts/class-recent-posts-widget.php:2
    • > PHP Notice
      Undefined variable: before_widget in wp-content/plugins/flexible-recent-posts/templates/recent-posts-widget.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/flexible-recent-posts/templates/recent-posts-widget.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category_Checklist' not found in wp-content/plugins/flexible-recent-posts/frp-walker-category-checklist.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/flexible-recent-posts/templates/recent-posts-form.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Widget options form), #2 (Widget on frontend)
The official readme.txt is a good inspiration

flexible-recent-posts/flexible-recent-posts.php Passed 13 tests

The primary PHP file in "Flexible Recent Posts" version 1.0.4 is used by WordPress to initiate all plugin functionality
53 characters long description:
Displays recent posts using flexible template system.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected861 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP611696524
CSS2354155
JavaScript31713115
PO File1263563
JSON1004

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.00
▷ Minimum class complexity4.00
▷ Maximum class complexity16.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/template-icons.png3.58KB2.05KB▼ 42.72%
images/help.png0.74KB0.64KB▼ 13.80%
images/custom-taxonomies.png2.15KB1.28KB▼ 40.57%
screenshot-1.png27.34KB11.32KB▼ 58.59%
screenshot-2.png34.99KB11.15KB▼ 68.13%