10% popular-posts-count

Code Review | Popular Posts Count

WordPress plugin Popular Posts Count scored10%from 54 tests.

About plugin

  • Plugin page: popular-posts-count
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2016
  • Latest release: Jan 4, 2018
  • Number of updates: 15
  • Update frequency: every 47.3 days
  • Top authors: coder.salman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /4,258 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/popular-posts-count/assets/main.php+46
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.80MB] [CPU: ▼52.96ms] Passed 4 tests

This is a short check of server-side resources used by Popular Posts Count
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.275.93 ▼39.90
Dashboard /wp-admin2.21 ▼1.098.35 ▼43.05
Posts /wp-admin/edit.php2.21 ▼1.157.18 ▼39.72
Add New Post /wp-admin/post-new.php2.21 ▼3.687.35 ▼89.16
Media Library /wp-admin/upload.php2.21 ▼1.027.65 ▼26.97

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_popular-posts-count
can_compress_scripts
db_upgraded
recovery_mode_email_last_sent
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Popular Posts Count
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,707 ▼2813.16 ▼1.591.18 ▼0.8524.84 ▼23.86
Dashboard /wp-admin2,223 ▲324.92 ▲0.0398.99 ▼15.8079.64 ▲33.58
Posts /wp-admin/edit.php2,106 ▲172.01 ▼0.0038.94 ▲2.2633.87 ▼1.58
Add New Post /wp-admin/post-new.php45 ▼1,4690.44 ▼17.130.10 ▼586.4511.09 ▼42.17
Media Library /wp-admin/upload.php1,408 ▲264.08 ▼0.15105.05 ▲4.4650.08 ▲7.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/popular-posts-count/assets/main.php+46
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_popular-posts-count
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: post views, popular posts, views, posts, popular...

popular-posts-count/index.php 85% from 13 tests

This is the main PHP file of "Popular Posts Count" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("popular-posts-count.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 199 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected644 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43535541
CSS21110103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.00
▷ Minimum class complexity2.00
▷ Maximum class complexity16.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 PNG files occupy 0.47MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png188.32KB78.99KB▼ 58.06%
assets/img/icon1.png.png2.16KB1.41KB▼ 34.75%
assets/icon-128x128.png.png13.07KB6.83KB▼ 47.73%
assets/img/icon.png1.88KB0.84KB▼ 55.44%
assets/screenshot-1.png.png188.32KB78.99KB▼ 58.06%