68% socialflow

Code Review | SocialFlow

WordPress plugin SocialFlow scored68%from 54 tests.

About plugin

  • Plugin page: socialflow
  • Plugin version: 3.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.2
  • WordPress version: 6.3.1
  • First release: Oct 24, 2011
  • Latest release: Jan 10, 2022
  • Number of updates: 109
  • Update frequency: every 34.2 days
  • Top authors: dizzain (71.56%)socialflow (23.85%)stresslimit (6.42%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /5,948 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.63ms] Passed 4 tests

Server-side resources used by SocialFlow
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.95 ▼3.73
Dashboard /wp-admin3.38 ▲0.0744.34 ▼5.11
Posts /wp-admin/edit.php3.55 ▲0.2053.50 ▲7.11
Add New Post /wp-admin/post-new.php6.01 ▲0.1280.73 ▼8.79
Media Library /wp-admin/upload.php3.35 ▲0.1345.68 ▲14.75

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 170 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
socialflow
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for SocialFlow
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲10013.28 ▼1.481.77 ▼0.2339.25 ▼3.65
Dashboard /wp-admin2,252 ▲645.85 ▲0.9794.48 ▼7.4480.57 ▲42.50
Posts /wp-admin/edit.php2,393 ▲3045.28 ▲3.2685.41 ▲47.9032.51 ▼4.39
Add New Post /wp-admin/post-new.php1,782 ▲26524.63 ▲7.06811.81 ▲202.4137.14 ▼25.75
Media Library /wp-admin/upload.php1,505 ▲1234.83 ▲0.55112.29 ▲14.3385.42 ▲41.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SocialFlow_Admin::uninstall() should not be called statically
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 28× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/socialflow/views/ng-form/compose-form.php
    • > /wp-content/plugins/socialflow/libs/class-wp-socialflow.php
    • > /wp-content/plugins/socialflow/views/ng-form/social-tabs/social-tabs-list.php
    • > /wp-content/plugins/socialflow/views/ng-form/social-tabs/social-tabs.php
    • > /wp-content/plugins/socialflow/views/ng-form/social-tabs/messages-list/settings/advanced-setting.php
    • > /wp-content/plugins/socialflow/views/ng-form/social-tabs/messages-list/message/message-twitter.php
    • > /wp-content/plugins/socialflow/includes/post/class-socialflow-post-compose.php
    • > /wp-content/plugins/socialflow/views/ng-form/stats/full.php
    • > /wp-content/plugins/socialflow/views/ng-form/accounts/accounts.php
    • > /wp-content/plugins/socialflow/includes/post/class-socialflow-post-accounts.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/socialflow/includes/class-sf-debug.php on line 20
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/socialflow/includes/class-sf-debug.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'SocialFlow_Admin_Settings_Page' not found in wp-content/plugins/socialflow/includes/settings/class-socialflow-admin-settings-categories.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'SocialFlow_Admin_Settings_Page' not found in wp-content/plugins/socialflow/includes/settings/class-socialflow-admin-settings-messages.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'SocialFlow_Admin_Settings_Page' not found in wp-content/plugins/socialflow/includes/settings/class-socialflow-admin-settings-accounts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/socialflow/views/notice/debug-send.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/socialflow/views/ng-form/social-tabs/messages-list/message/input-show-check-box.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'SocialFlow_Methods' not found in wp-content/plugins/socialflow/includes/class-socialflow.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/socialflow/views/notice/options-updated.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/socialflow/views/notice/not-authorized.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #5 (SocialFlow Post Meta Box with Stats)
The official readme.txt might help

socialflow/socialflow.php 92% from 13 tests

The primary PHP file in "SocialFlow" version 3.3.6 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 144 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
Success! There were no dangerous files found in this plugin32,288 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript474,40118,57421,634
PHP471,3413,4185,559
CSS34263222,488
Sass29337442,063
SVG206320426
JSON20061
Markdown11033
Handlebars40024

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity26.69
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes00.00%
Methods333
▷ Static methods154.50%
▷ Public methods26178.38%
▷ Protected methods6218.62%
▷ Private methods103.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/reload.png0.75KB0.64KB▼ 14.15%
assets/images/menu-icon.png0.57KB1.04KB0.00%
assets/images/socialflow.png1.64KB1.38KB▼ 15.91%
assets/images/thumb-nav.png0.39KB0.39KB0.00%