55% blog2social

Code Review | Blog2Social: Social Media Auto Post & Scheduler

WordPress plugin Blog2Social: Social Media Auto Post & Scheduler scored55%from 54 tests.

About plugin

  • Plugin page: blog2social
  • Plugin version: 7.3.4
  • PHP compatiblity: 5.5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 11, 2014
  • Latest release: Nov 13, 2023
  • Number of updates: 760
  • Update frequency: every 4.3 days
  • Top authors: Blog2Social (54.74%)PR-Gateway (45.39%)

Code review

54 tests

User reviews

1863 reviews

Install metrics

70,000+ active /3,217,249 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.68MB] [CPU: ▲13.27ms] 75% from 4 tests

Server-side resources used by Blog2Social: Social Media Auto Post & Scheduler
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,119.52ms on /wp-admin/admin.php?page=blog2social-settings)
PageMemory (MB)CPU Time (ms)
Home /4.92 ▲1.4545.93 ▲3.84
Dashboard /wp-admin6.41 ▲3.0672.53 ▲11.92
Posts /wp-admin/edit.php6.53 ▲3.1665.73 ▲15.66
Add New Post /wp-admin/post-new.php8.99 ▲3.10119.25 ▲21.67
Media Library /wp-admin/upload.php6.33 ▲3.1063.75 ▲30.76
Help & Support /wp-admin/admin.php?page=blog2social-support6.751,167.97
B2S Onboarding /wp-admin/admin.php?page=blog2social-onboarding6.68254.19
B2S Post Notice /wp-admin/admin.php?page=blog2social-notice6.95284.65
Social Media Posts /wp-admin/admin.php?page=blog2social-curation6.77261.12
B2S Ship /wp-admin/admin.php?page=blog2social-ship6.9453.12
B2S Post Publish /wp-admin/admin.php?page=blog2social-publish6.96248.81
Video Posts /wp-admin/admin.php?page=blog2social-video7.02254.63
PR-Service /wp-admin/admin.php?page=prg-post6.4259.91
B2S Network APP Management /wp-admin/admin.php?page=blog2social-user-apps6.81489.25
Settings /wp-admin/admin.php?page=blog2social-settings7.661,119.52

Server storage [IO: ▲8.52MB] [DB: ▲0.11MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 348 new files
Database: 10 new tables, 6 new options
New tables
wp_b2s_posts_sched_details
wp_b2s_posts_favorites
wp_b2s_posts
wp_b2s_posts_drafts
wp_b2s_user
wp_b2s_user_contact
wp_b2s_user_network_settings
wp_b2s_posts_insights
wp_b2s_network_insights
wp_b2s_posts_network_details
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Blog2Social: Social Media Auto Post & Scheduler
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲19714.55 ▲0.151.72 ▼0.3241.69 ▼0.13
Dashboard /wp-admin2,330 ▲1535.67 ▲0.0384.70 ▼6.4765.75 ▲21.97
Posts /wp-admin/edit.php2,234 ▲1341.99 ▲0.0340.33 ▼2.2338.60 ▼2.04
Add New Post /wp-admin/post-new.php1,799 ▲27322.36 ▼0.93710.98 ▲85.5060.00 ▲10.77
Media Library /wp-admin/upload.php1,535 ▲1354.10 ▼0.15100.74 ▼1.5562.73 ▲20.42
Help & Support /wp-admin/admin.php?page=blog2social-support2,7711.9836.76103.07
B2S Onboarding /wp-admin/admin.php?page=blog2social-onboarding2,3352.4333.5548.55
B2S Post Notice /wp-admin/admin.php?page=blog2social-notice3,8902.1945.1351.15
Social Media Posts /wp-admin/admin.php?page=blog2social-curation3,2973.9783.20120.43
B2S Ship /wp-admin/admin.php?page=blog2social-ship5,6885.89138.69524.96
B2S Post Publish /wp-admin/admin.php?page=blog2social-publish3,9482.1948.3348.38
Video Posts /wp-admin/admin.php?page=blog2social-video4,3949.56272.14115.85
PR-Service /wp-admin/admin.php?page=prg-post1,3311.8329.9338.31
B2S Network APP Management /wp-admin/admin.php?page=blog2social-user-apps3,7622.1138.9158.86
Settings /wp-admin/admin.php?page=blog2social-settings6,8013.6955.33111.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 10 tables in the database
    • wp_b2s_posts_network_details
    • wp_b2s_posts_sched_details
    • wp_b2s_network_insights
    • wp_b2s_user_contact
    • wp_b2s_user_network_settings
    • wp_b2s_posts_favorites
    • wp_b2s_posts
    • wp_b2s_user
    • wp_b2s_posts_insights
    • wp_b2s_posts_drafts
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+392
    Undefined index: postId
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+1027
    Trying to get property 'ID' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+1014
    Trying to get property 'guid' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+395
    Trying to get property 'post_title' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+1049
    Trying to get property 'post_status' of non-object
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+87
    Trying to get property 'post_date' of non-object
    • > GET request to /wp-admin/admin.php?page=blog2social-ship
    • > Notice in wp-content/plugins/blog2social/views/b2s/ship.php+680
    Trying to get property 'post_content' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/blog2social/views/b2s/widgets/content.php
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/blog2social/views/b2s/html/sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'B2S_System' not found in wp-content/plugins/blog2social/views/prg/html/footer.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'B2S_PLUGIN_DIRincludes/B2S/Calendar/Item.php' (include_path='.:/usr/share/php') in wp-content/plugins/blog2social/includes/B2S/Calendar/Filter.php on line 3
    • > PHP Warning
      Use of undefined constant B2S_PLUGIN_DIR - assumed 'B2S_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/blog2social/includes/B2S/Calendar/Item.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/blog2social/views/b2s/partials/post-edit-modal.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/blog2social/views/prg/ship.php:2
    • > PHP Warning
      Use of undefined constant B2S_PLUGIN_DIR - assumed 'B2S_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/blog2social/includes/B2S/Calendar/ItemEdit.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/blog2social/views/b2s/post.favorites.php:2
    • > PHP Warning
      require_once(B2S_PLUGIN_DIRincludes/B2S/Ship/Save.php): failed to open stream: No such file or directory in wp-content/plugins/blog2social/includes/B2S/Calendar/Save.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'B2S_PLUGIN_DIRincludes/B2S/Calendar/ItemEdit.php' (include_path='.:/usr/share/php') in wp-content/plugins/blog2social/includes/B2S/Calendar/Item.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=blog2social-video
    • > Security (severe) in unknown
    security - [Report Only] Refused to frame 'https://docs.google.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
    • > GET request to /wp-admin/admin.php?page=blog2social-video
    • > Network (severe)
    filesystem:https://docs.google.com/persistent/docs/fonts/KFOmCnqEu92Fr1Me4A.woff2 - Failed to load resource: net::ERR_FILE_NOT_FOUND
    • > GET request to /wp-admin/admin.php?page=blog2social-video
    • > Network (severe)
    filesystem:https://docs.google.com/persistent/docs/fonts/KFOkCnqEu92Fr1Mu52xK.woff2 - Failed to load resource: net::ERR_FILE_NOT_FOUND
    • > GET request to /wp-admin/admin.php?page=blog2social-video
    • > Network (severe)
    filesystem:https://docs.google.com/persistent/docs/fonts/KFOlCnqEu92Fr1MmWUlvBg.woff2 - Failed to load resource: net::ERR_FILE_NOT_FOUND
    • > GET request to /wp-admin/admin.php?page=blog2social-video
    • > Network (severe)
    filesystem:https://docs.google.com/persistent/docs/fonts/KFOjCnqEu92Fr1Mu51TzBhc4.woff2 - Failed to load resource: net::ERR_FILE_NOT_FOUND

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 130 tag instead of maximum 10
  • Screenshots: These screenshots need descriptions #8, #9 in blog2social/assets to your readme.txt
The official readme.txt might help

blog2social/blog2social.php Passed 13 tests

The main PHP script in "Blog2Social: Social Media Auto Post & Scheduler" version 7.3.4 is automatically included on every request by WordPress
131 characters long description:
Auto publish, schedule & share posts on social media: Facebook, Twitter, XING, LinkedIn, Instagram, ... crosspost to pages & groups

Code Analysis 95% from 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
Everything looks great! No dangerous files found in this plugin75,381 lines of code in 195 files:
LanguageFilesBlank linesComment linesLines of code
PHP972,32878528,779
JavaScript512,5301,09221,385
CSS411,35015615,025
PO File54,5595,8769,904
SVG100288

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,356)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 485)
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity137.36
▷ Minimum class complexity1.00
▷ Maximum class complexity1,356.00
Average method complexity13.33
▷ Minimum method complexity1.00
▷ Maximum method complexity485.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes00.00%
Methods581
▷ Static methods9015.49%
▷ Public methods46780.38%
▷ Protected methods91.55%
▷ Private methods10518.07%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants76
▷ Global constants76100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
139 PNG files occupy 1.53MB with 0.92MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/no-network-selected.png28.87KB10.67KB▼ 63.04%
assets/images/settings/b2s-post-format-2-2-en.png8.22KB3.88KB▼ 52.78%
assets/images/b2s/trial_popup.png79.90KB26.84KB▼ 66.40%
assets/images/portale/4_flat.png5.54KB1.83KB▼ 66.88%
assets/images/settings/b2s-post-format-2-2-de.png8.24KB4.04KB▼ 50.90%