83% popular-posts-by-webline

Code Review | Popular Posts by Webline

WordPress plugin Popular Posts by Webline scored83%from 54 tests.

About plugin

  • Plugin page: popular-posts-by-...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2014
  • Latest release: Feb 1, 2023
  • Number of updates: 30
  • Update frequency: every 99.2 days
  • Top authors: WeblineIndia (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /22,714 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 gracefully, with no errors

Server metrics [RAM: ▲0.29MB] [CPU: ▼8.39ms] Passed 4 tests

This is a short check of server-side resources used by Popular Posts by Webline
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2941.32 ▼0.57
Dashboard /wp-admin3.60 ▲0.2650.73 ▼16.03
Posts /wp-admin/edit.php3.72 ▲0.3653.39 ▼0.00
Add New Post /wp-admin/post-new.php6.18 ▲0.3091.73 ▼16.95
Media Library /wp-admin/upload.php3.52 ▲0.3040.20 ▲2.21
Popular Posts - By Webline /wp-admin/options-general.php?page=wli-popular-posts-by-webline3.5247.78

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
wli_popular_posts_settings
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Popular Posts by Webline
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,936 ▲17513.54 ▼0.725.71 ▲3.9939.46 ▼1.99
Dashboard /wp-admin2,219 ▲155.85 ▼0.10108.33 ▼5.9538.36 ▼2.52
Posts /wp-admin/edit.php2,114 ▲111.98 ▼0.0341.16 ▼0.1236.74 ▼0.27
Add New Post /wp-admin/post-new.php1,529 ▼1923.56 ▲0.37604.08 ▼62.6752.31 ▼10.47
Media Library /wp-admin/upload.php1,407 ▲74.26 ▲0.0698.29 ▼1.3943.17 ▼5.81
Popular Posts - By Webline /wp-admin/options-general.php?page=wli-popular-posts-by-webline1,9344.0078.4937.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • wli_popular_posts_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/popular-posts-by-webline/admin/class/hook.php:11
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/template.php): failed to open stream: No such file or directory in wp-content/plugins/popular-posts-by-webline/admin/class/walker.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/popular-posts-by-webline/admin/class/walker.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/popular-posts-by-webline/admin/class/walker.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/popular-posts-by-webline/admin/class/popular-posts.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #13 (Frontend widget to display populat products slider), #14 (Frontend shortcode to display popular products listing), #15 (Frontend shortcode to display popular posts slider)
You can take inspiration from this readme.txt

popular-posts-by-webline/popularposts-by-webline.php 85% from 13 tests

The main PHP file in "Popular Posts by Webline" ver. 1.0.7 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 143 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("popular-posts-by-webline.php" instead of "popularposts-by-webline.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,666 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP52372681,254
CSS4455354
JavaScript311645
SVG11013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity54.33
▷ Minimum class complexity4.00
▷ Maximum class complexity107.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/logo.png0.24KB0.25KB0.00%
admin/assets/images/date_icon.png1.47KB0.87KB▼ 41.32%
admin/assets/images/view_icon.png0.53KB0.35KB▼ 34.92%
admin/assets/images/comment_icon.png0.64KB0.39KB▼ 39.79%