78% ultimate-posts-widget

Code Review | Ultimate Posts Widget

WordPress plugin Ultimate Posts Widget scored78%from 54 tests.

About plugin

  • Plugin page: ultimate-posts-wi...
  • Plugin version: 2.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 10, 2012
  • Latest release: Nov 14, 2023
  • Number of updates: 120
  • Update frequency: every 35.1 days
  • Top authors: bostondv (70.83%)cl272 (13.33%)iclyde (10.83%)upwsupport (7.5%)

Code review

54 tests

User reviews

56 reviews

Install metrics

10,000+ active /440,537 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▲5.05ms] Passed 4 tests

This is a short check of server-side resources used by Ultimate Posts Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5446.68 ▲3.85
Dashboard /wp-admin3.88 ▲0.5758.57 ▲5.12
Posts /wp-admin/edit.php3.98 ▲0.6256.69 ▲6.17
Add New Post /wp-admin/post-new.php6.47 ▲0.5898.67 ▲5.04
Media Library /wp-admin/upload.php3.80 ▲0.5741.08 ▲6.34

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Ultimate Posts Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,090 ▲32814.40 ▲0.051.70 ▼0.0642.48 ▼3.70
Dashboard /wp-admin2,493 ▲3225.70 ▲0.12102.10 ▼0.4284.55 ▲40.81
Posts /wp-admin/edit.php2,418 ▲3182.11 ▲0.1245.19 ▲10.7547.22 ▲10.16
Add New Post /wp-admin/post-new.php1,831 ▲30520.82 ▼2.99670.20 ▲47.0747.85 ▼6.69
Media Library /wp-admin/upload.php1,698 ▲2984.28 ▲0.06107.46 ▲1.2177.57 ▲33.29

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_recent-comments
    • can_compress_scripts
    • analyst_cache
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_sticky-posts
    • theysaidso_admin_options
    • analyst_accounts_data
    • _tifm_force_disable_feature_update

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/ultimate-posts-widget/analyst/templates/forms/deactivate.php
    • > /wp-content/plugins/ultimate-posts-widget/analyst/templates/forms/install.php
    • > /wp-content/plugins/ultimate-posts-widget/analyst/templates/optin.php
    • > /wp-content/plugins/ultimate-posts-widget/analyst/templates/optout.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Http\\Requests\\AbstractLoggerRequest' not found in wp-content/plugins/ultimate-posts-widget/analyst/src/Http/Requests/ActivateRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Http\\Requests\\AbstractLoggerRequest' not found in wp-content/plugins/ultimate-posts-widget/analyst/src/Http/Requests/OptOutRequest.php:18
    • > PHP Notice
      Undefined variable: shieldImage in wp-content/plugins/ultimate-posts-widget/analyst/templates/forms/install.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-posts-widget/templates/standard.php on line 9
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/ultimate-posts-widget/templates/standard.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Core\\AbstractFactory' not found in wp-content/plugins/ultimate-posts-widget/analyst/src/Account/AccountDataFactory.php:15
    • > PHP Notice
      Undefined variable: shieldImage in wp-content/plugins/ultimate-posts-widget/analyst/templates/optout.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-posts-widget/templates/legacy.php on line 9
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\AnalystContract' not found in wp-content/plugins/ultimate-posts-widget/analyst/src/Analyst.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ultimate-posts-widget/analyst/sdk_resolver.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Too many tags (24 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

ultimate-posts-widget/ultimate-posts-widget.php Passed 13 tests

The entry point to "Ultimate Posts Widget" version 2.2.9 is a PHP file that has certain tags in its header comment area
101 characters long description:
The ultimate widget for displaying posts, custom post types or sticky posts with an array of options.

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
Everything looks great! No dangerous files found in this plugin4,762 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP641,1041,4633,765
CSS4484370
JavaScript3426336
SVG2802177
Sass2150114

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.42
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces9
Interfaces6
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes00.00%
Methods205
▷ Static methods2311.22%
▷ Public methods17786.34%
▷ Protected methods104.88%
▷ Private methods188.78%
Functions29
▷ Named functions827.59%
▷ Anonymous functions2172.41%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
34 PNG files occupy 0.65MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner/views/projects/usm/imgs/big-colored-logo.png10.69KB10.50KB▼ 1.71%
banner/views/projects/fit/imgs/face4.png2.59KB2.43KB▼ 6.22%
assets/banner-772x250.png54.62KB14.78KB▼ 72.94%
assets/screenshot-4.png40.24KB13.26KB▼ 67.05%
banner/views/projects/mpu/imgs/background-texture-grey.png5.22KB5.46KB0.00%