83% social-counter

Code Review | Social Counter

WordPress plugin Social Counter scored83%from 54 tests.

About plugin

  • Plugin page: social-counter
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Feb 7, 2022
  • Number of updates: 47
  • Update frequency: every 57.2 days
  • Top authors: Prisna (63.83%)djjmz (38.3%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active /19,298 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▲0.86ms] Passed 4 tests

Server-side resources used by Social Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4438.62 ▼5.52
Dashboard /wp-admin3.77 ▲0.4645.83 ▼1.16
Posts /wp-admin/edit.php3.82 ▲0.4649.35 ▲6.47
Add New Post /wp-admin/post-new.php6.35 ▲0.4694.59 ▲5.29
Media Library /wp-admin/upload.php3.69 ▲0.4638.70 ▲4.84
Social Counter /wp-admin/plugins.php?page=prisna-social-counter-settings4.0539.39

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 62 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_prisna-social-counter
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Social Counter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.30 ▼1.321.48 ▼0.3139.87 ▼6.96
Dashboard /wp-admin2,214 ▲264.84 ▼0.02109.62 ▼2.5541.90 ▼0.97
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0539.93 ▲2.2335.97 ▲2.60
Add New Post /wp-admin/post-new.php1,531 ▲1717.93 ▲0.22637.69 ▼49.1650.40 ▼12.45
Media Library /wp-admin/upload.php1,389 ▼24.16 ▼0.0596.01 ▼1.8542.66 ▼2.28
Social Counter /wp-admin/plugins.php?page=prisna-social-counter-settings2,8012.3547.5748.33

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_prisna-social-counter
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaSocialCounterItem' not found in wp-content/plugins/social-counter/classes/admin.class.php:171
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/social-counter/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-counter/social-counter.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-counter/classes/common.class.php:451
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaSocialCounterItem' not found in wp-content/plugins/social-counter/classes/main.class.php:208

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% 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
Please fix the following attributes:
  • Tags: There are too many tags (17 tag instead of maximum 10)
The official readme.txt might help

social-counter/social-counter.php 85% from 13 tests

Analyzing the main PHP file in "Social Counter" version 2.0.5
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 185 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin7,999 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,136212,316
SVG2312,082
JavaScript2428481,937
CSS228251,364
PO File18594300

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.30
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes26.06%
▷ Concrete classes3193.94%
▷ Final classes00.00%
Methods193
▷ Static methods9247.67%
▷ Public methods12966.84%
▷ Protected methods6433.16%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/checkbox.png0.24KB0.17KB▼ 29.03%
images/fb.png1.30KB1.60KB0.00%
images/checkbox_parent.png0.09KB0.10KB0.00%
images/logo_white.png2.48KB2.10KB▼ 15.40%
images/sprites.png17.38KB8.54KB▼ 50.90%