84% show-posts

Code Review | Weaver Show Posts

WordPress plugin Weaver Show Posts scored84%from 54 tests.

About plugin

  • Plugin page: show-posts
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 7.2-6.3
  • WordPress version: 6.3.1
  • First release: Feb 17, 2014
  • Latest release: Aug 5, 2023
  • Number of updates: 41
  • Update frequency: every 84.8 days
  • Top authors: wpweaver (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

10,000+ active /203,311 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.04ms] Passed 4 tests

A check of server-side resources used by Weaver Show Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.06 ▼2.99
Dashboard /wp-admin3.32 ▲0.0246.86 ▼2.08
Posts /wp-admin/edit.php3.38 ▲0.0246.96 ▼0.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.48 ▼10.84
Media Library /wp-admin/upload.php3.25 ▲0.0236.04 ▲2.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 46 new files
Database: no new tables, 8 new options
New WordPress options
atw_posts_settings
widget_wvr_showposts
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Weaver Show Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5714.74 ▲0.361.49 ▼0.4144.84 ▲7.84
Dashboard /wp-admin2,221 ▲414.86 ▼0.17103.88 ▼5.2240.56 ▼4.26
Posts /wp-admin/edit.php2,101 ▲122.06 ▲0.0234.39 ▼1.0233.71 ▼0.16
Add New Post /wp-admin/post-new.php1,543 ▲923.07 ▼0.13677.43 ▲6.6752.94 ▼14.82
Media Library /wp-admin/upload.php1,397 ▲64.29 ▲0.13106.62 ▲8.2745.27 ▲2.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_wvr_showposts
    • theysaidso_admin_options
    • atw_posts_settings
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WEAVER_SHOWPOSTS_TEMPLATE - assumed 'WEAVER_SHOWPOSTS_TEMPLATE' (this will throw an Error in a future version of PHP) in wp-content/plugins/show-posts/includes/atw-posts-filters-admin.php on line 899
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/show-posts/includes/posts-widgets.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/show-posts/atw-show-posts.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/show-posts/includes/downloader.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: weaver theme, subthemes, save, settings

show-posts/atw-show-posts.php 92% from 13 tests

"Weaver Show Posts" version 1.8.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("show-posts.php" instead of "atw-show-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected3,478 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP147253412,592
HTML150414
CSS45935298
JavaScript67711174

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions113
▷ Named functions113100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
19 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/edit-1.png3.13KB0.42KB▼ 86.43%
images/icons/download.png1.50KB0.33KB▼ 77.72%
images/icons/category-1.png3.01KB0.43KB▼ 85.86%
images/icons/permalink-1.png0.48KB0.41KB▼ 15.65%
images/icons/tag-1.png3.37KB0.71KB▼ 79.04%