10% wpsocialstats

Code Review | Social Media Stats

WordPress plugin Social Media Stats scored10%from 54 tests.

About plugin

  • Plugin page: wpsocialstats
  • Plugin version: 2.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2012
  • Latest release: Jul 21, 2022
  • Number of updates: 86
  • Update frequency: every 41.6 days
  • Top authors: thewebcitizen (86.05%)ankit.gade@rtcamp.com (10.47%)wprepublic (5.81%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /16,027 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/wpsocialstats/classes/social_stats_table.php+66
    Declaration of Social_Stats_Table::get_sortable_columns($is_sortable) should be compatible with WP_List_Table::get_sortable_columns()

Server metrics [RAM: ▼1.96MB] [CPU: ▼56.21ms] Passed 4 tests

A check of server-side resources used by Social Media Stats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.67 ▼41.34
Dashboard /wp-admin2.05 ▼1.266.48 ▼46.17
Posts /wp-admin/edit.php2.05 ▼1.316.13 ▼47.66
Add New Post /wp-admin/post-new.php2.05 ▼3.846.25 ▼89.67
Media Library /wp-admin/upload.php2.05 ▼1.184.78 ▼37.67
Settings /wp-admin/admin.php?page=auto-update-state-options2.055.43
Dashboard /wp-admin/admin.php?page=wp_social_stats_main2.056.46

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 11 new options
New WordPress options
wp_social_stats_show_per_page
widget_most-shared-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
wp_social_stats_show_date
wp_social_stats_show
...

Browser metrics Passed 4 tests

A check of browser resources used by Social Media Stats
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲10913.27 ▼1.111.98 ▲0.0942.75 ▼0.20
Dashboard /wp-admin2,237 ▲465.85 ▲0.98105.86 ▼2.7682.96 ▲41.39
Posts /wp-admin/edit.php2,124 ▲351.98 ▼0.0337.49 ▼2.7433.61 ▼2.74
Add New Post /wp-admin/post-new.php1,543 ▲1023.10 ▼0.13664.95 ▼33.5348.84 ▼9.29
Media Library /wp-admin/upload.php1,413 ▲224.15 ▼0.08103.83 ▼3.9375.05 ▲29.31
Settings /wp-admin/admin.php?page=auto-update-state-options8452.2533.3529.15
Dashboard /wp-admin/admin.php?page=wp_social_stats_main1,2303.4484.3648.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wpsocialstats/classes/social_stats_table.php+66
    Declaration of Social_Stats_Table::get_sortable_columns($is_sortable) should be compatible with WP_List_Table::get_sortable_columns()
  • Zombie WordPress options were found after uninstall: 11 options
    • wp_social_stats_show_date
    • wp_social_stats_show_per_page
    • wp_social_stats_show
    • widget_most-shared-posts
    • wp_social_stats_cat_id
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_social_stats_main
    • > Warning in wp-content/plugins/wpsocialstats/classes/social_stats_table.php+66
    Declaration of Social_Stats_Table::get_sortable_columns($is_sortable) should be compatible with WP_List_Table::get_sortable_columns()
    • > GET request to /wp-admin/admin.php?page=wp_social_stats_main
    • > Notice in wp-content/plugins/wpsocialstats/classes/social_stats_table.php+576
    Undefined variable: paged

SRP 50% from 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
The following issues need your attention
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 17
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 29
    • > PHP Notice
      Undefined variable: category_dropdown in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 20
    • > PHP Warning
      Use of undefined constant SOCIAL_STATISTICS_PLUGIN_URL - assumed 'SOCIAL_STATISTICS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpsocialstats/templates/social-media-tips-page.php on line 4
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 28
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpsocialstats/wp-social-stats.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 28
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpsocialstats/templates/admin-page.php on line 29
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wpsocialstats/templates/social-media-tips-page.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: social media analytics, social media metrics, social media, social media stats

wpsocialstats/wp-social-stats.php 85% from 13 tests

The main PHP script in "Social Media Stats" version 2.0.7 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpsocialstats.php" instead of "wp-social-stats.php")

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
There were no executable files found in this plugin1,906 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP95172231,289
JavaScript313417342
CSS2250275

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity55.67
▷ Minimum class complexity24.00
▷ Maximum class complexity77.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants838.10%
▷ Class constants1361.90%
▷ Public constants13100.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
12 PNG files occupy 0.31MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png25.61KB9.40KB▼ 63.32%
images/up-arrow.png0.26KB0.19KB▼ 25.76%
screenshot-4.png57.76KB20.49KB▼ 64.53%
icon/logo.png1.30KB1.09KB▼ 16.20%
images/down-arrow.png0.27KB0.19KB▼ 28.83%