83% posts-shared-counter-for-social-website

Code Review | Posts shared counter for social website

WordPress plugin Posts shared counter for social website scored83%from 54 tests.

About plugin

  • Plugin page: posts-shared-coun...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1
  • WordPress version: 6.3.1
  • First release: Jul 15, 2014
  • Latest release: Dec 23, 2014
  • Number of updates: 115
  • Update frequency: every 1.4 days
  • Top authors: maffay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,307 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.00MB] [CPU: ▼6.33ms] Passed 4 tests

A check of server-side resources used by Posts shared counter for social website
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.11 ▲1.83
Dashboard /wp-admin3.32 ▼0.0244.99 ▼12.28
Posts /wp-admin/edit.php3.36 ▲0.01253.11 ▲208.07
Add New Post /wp-admin/post-new.php5.90 ▲0.0282.25 ▼11.52
Media Library /wp-admin/upload.php3.24 ▲0.0132.32 ▼3.34

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 18 new files
Database: 1 new table, 16 new options
New tables
wp_kuazasocialtracker
New WordPress options
kspt_enable_plugins
kspt_konu_otomatik
kspt_konudagoster_neresi
widget_recent-posts
kspt_cache_time
widget_recent-comments
widget_theysaidso_widget
kspt_disable_search
kspt_settimetime
db_upgraded
...

Browser metrics Passed 4 tests

Posts shared counter for social website: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.57 ▼0.741.70 ▼0.1045.61 ▲6.65
Dashboard /wp-admin2,222 ▲315.86 ▲0.81149.55 ▲42.7645.99 ▲3.47
Posts /wp-admin/edit.php1,218 ▼8711.14 ▼0.867.55 ▼27.9929.32 ▼5.30
Add New Post /wp-admin/post-new.php6,224 ▲4,68218.95 ▲0.83889.86 ▲255.5256.24 ▲5.02
Media Library /wp-admin/upload.php1,398 ▲134.22 ▲0.0199.14 ▼18.4939.85 ▼7.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/posts-shared-counter-for-social-website/class.kpst-counter-widget.php:6

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add images for these screenshots: #1 (Displey the content before), #2 (Widget for popular shared posts list), #3 (Widget for all statistic for shared), #4 (Default STYLE (1)), #5 (Jumbo STYLE (2))
Please take inspiration from this readme.txt

posts-shared-counter-for-social-website/kuaza-post-shared-counter.php 92% from 13 tests

The main PHP file in "Posts shared counter for social website" ver. 2.3 adds more information about the plugin and also serves as the entry point for this plugin
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 ("posts-shared-counter-for-social-website.php" instead of "kuaza-post-shared-counter.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
No dangerous file extensions were detected2,668 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP33792011,896
PO File3294309732
JavaScript14040

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.67
▷ Minimum class complexity8.00
▷ Maximum class complexity39.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1593.75%
▷ Protected methods00.00%
▷ Private methods16.25%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.30MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png248.65KB87.98KB▼ 64.62%
screenshot-1.png14.34KB5.75KB▼ 59.94%
screenshot-4.png3.34KB1.75KB▼ 47.56%
screenshot-5.png4.28KB2.87KB▼ 33.04%
screenshot-3.png33.57KB11.71KB▼ 65.14%