65% blog2social

Code Review | Blog2Social: Social Media Auto Post & Scheduler

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

About plugin

  • Plugin page: blog2social
  • Plugin version: 6.9.4
  • PHP compatiblity: 5.5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.9
  • WordPress version: 5.9.2
  • First release: Nov 11, 2014
  • Latest release: Apr 5, 2022
  • Number of updates: 676
  • Update frequency: every 4.0 days
  • Top authors: Blog2Social (61.54%)PR-Gateway (38.61%)

Code review

54 tests

User reviews

1566 reviews

Install metrics

70,000+ active / 2,197,885 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲2.34MB] [CPU: ▼293.53ms] 75% from 4 tests

A check of server-side resources used by Blog2Social: Social Media Auto Post & Scheduler
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,171.61ms on /wp-admin/admin.php?page=blog2social-repost)
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.2877.46 ▲9.15
Dashboard /wp-admin6.14 ▲2.7353.49 ▲11.99
Posts /wp-admin/edit.php6.37 ▲2.7363.05 ▲13.18
Add New Post /wp-admin/post-new.php9.60 ▲2.63151.20 ▼1,208.44
Media Library /wp-admin/upload.php6.02 ▲2.7355.19 ▲22.03
B2S Post Draft /wp-admin/admin.php?page=blog2social-draft-post6.631,141.91
PREMIUM /wp-admin/admin.php?page=blog2social-premium6.43307.53
Networks /wp-admin/admin.php?page=blog2social-network7.16764.09
PRG Ship /wp-admin/admin.php?page=prg-ship6.0246.40
B2S Autoposter /wp-admin/admin.php?page=blog2social-autopost6.691,363.27
Calendar /wp-admin/admin.php?page=blog2social-calendar8.09977.53
B2S Reposter /wp-admin/admin.php?page=blog2social-repost7.141,171.61
PRG Login /wp-admin/admin.php?page=prg-login6.0039.47
Help & Support /wp-admin/admin.php?page=blog2social-support6.45385.99
Social Media Posts /wp-admin/admin.php?page=blog2social-curation6.50350.57

Server storage [IO: ▲7.90MB] [DB: ▲0.06MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 302 new files
Database: 10 new tables, no new options
New tables
wp_b2s_network_insights
wp_b2s_user_network_settings
wp_b2s_posts_sched_details
wp_b2s_posts_network_details
wp_b2s_posts_favorites
wp_b2s_posts
wp_b2s_user
wp_b2s_posts_insights
wp_b2s_user_contact
wp_b2s_posts_drafts

Browser metrics Passed 4 tests

Blog2Social: Social Media Auto Post & Scheduler: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,043 ▲29915.98 ▲0.4912.86 ▲5.074.30 ▲1.32
Dashboard /wp-admin3,131 ▲2116.44 ▲0.03185.04 ▼18.04208.41 ▲2.32
Posts /wp-admin/edit.php2,889 ▲1713.45 ▲0.0284.54 ▼22.39171.89 ▼6.71
Add New Post /wp-admin/post-new.php1,831 ▲21821.13 ▼0.54638.26 ▼25.01231.70 ▲9.19
Media Library /wp-admin/upload.php1,897 ▲1675.72 ▼0.09176.83 ▼26.24286.61 ▲41.59
B2S Post Draft /wp-admin/admin.php?page=blog2social-draft-post6,4633.76130.72242.58
PREMIUM /wp-admin/admin.php?page=blog2social-premium3,7383.4592.10203.50
Networks /wp-admin/admin.php?page=blog2social-network9,1053.49101.58251.75
PRG Ship /wp-admin/admin.php?page=prg-ship5,0903.0079.02149.14
B2S Autoposter /wp-admin/admin.php?page=blog2social-autopost6,1633.74119.68191.88
Calendar /wp-admin/admin.php?page=blog2social-calendar6,4257.35236.50361.82
B2S Reposter /wp-admin/admin.php?page=blog2social-repost8,3757.51258.86327.23
PRG Login /wp-admin/admin.php?page=prg-login1,3742.8780.25134.65
Help & Support /wp-admin/admin.php?page=blog2social-support4,0003.1192.26241.81
Social Media Posts /wp-admin/admin.php?page=blog2social-curation4,7686.11125.64202.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 10 tables in the database
    • wp_b2s_posts_favorites
    • wp_b2s_user_contact
    • wp_b2s_user
    • wp_b2s_posts
    • wp_b2s_posts_drafts
    • wp_b2s_posts_sched_details
    • wp_b2s_posts_network_details
    • wp_b2s_posts_insights
    • wp_b2s_user_network_settings
    • wp_b2s_network_insights

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=prg-login
    • > Notice in wp-content/plugins/blog2social/views/prg/login.php+26
    Undefined index: postId
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=prg-ship
    • > Notice in wp-content/plugins/blog2social/views/prg/ship.php+64
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/admin.php?page=prg-ship
    • > Notice in wp-content/plugins/blog2social/views/prg/ship.php+10
    Trying to get property 'guid' of non-object
    • > GET request to /wp-admin/admin.php?page=prg-ship
    • > Notice in wp-content/plugins/blog2social/views/prg/ship.php+13
    Trying to get property 'post_title' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=prg-ship
    • > Notice in wp-content/plugins/blog2social/views/prg/ship.php+17
    Trying to get property 'post_content' of non-object

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blog2social/views/b2s/widgets/content.php
  • 61× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'B2S_System' not found in wp-content/plugins/blog2social/views/b2s/html/sidebar.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/views/b2s/widgets/calendar.php on line 3
    • > PHP Warning
      require_once(B2S_PLUGIN_DIRincludes/B2S/Ship/Item.php): failed to open stream: No such file or directory 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/metrics.php: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 Fatal error
      require_once(): Failed opening required 'B2S_PLUGIN_DIRincludes/B2S/Post/Filter.php' (include_path='.:/usr/share/php') in wp-content/plugins/blog2social/views/b2s/widgets/posts.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/blog2social/views/b2s/curation.draft.php:2
    • > 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: Call to undefined function wp_nonce_field() in wp-content/plugins/blog2social/views/b2s/ship.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/blog2social/views/notice.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=blog2social-repost
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31592 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'format')" "TypeError: Cannot read properties of undefined (reading 'format')\n at f (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:14772)\n at h (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:13866)\n at u (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:13758)\n at constructor.a [as refetchEvents] (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:13517)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:21203)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:3003)\n at s.fn.init.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:1481)\n at s.fn.init.t.fn.fullCalendar (/wp-content/plugins/blog2social/assets/lib/fullcalendar/fullcalendar.min.js?ver=694:5:21096)\n at refreshCalender (/wp-content/plugins/blog2social/assets/js/b2s/repost.js?ver=694:953:29)\n at renderCalender (/wp-content/plugins/blog2social/assets/js/b2s/repost.js?ver=694:1072:5)" undefined
    • > GET request to /wp-admin/admin.php?page=blog2social-repost
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31702 Uncaught TypeError: Cannot read properties of undefined (reading 'format')
    • > GET request to /wp-admin/admin.php?page=blog2social-curation
    • > Javascript (severe) in unknown
    /wp-includes/js/wp-auth-check.min.js?ver=5.9.2 1:654 Uncaught TypeError: Cannot read properties of undefined (reading 'hasClass')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 130 tag instead of maximum 10
  • Screenshots: These screenshots lack descriptions #8, #9 in blog2social/assets to your readme.txt
Please take inspiration from this readme.txt

blog2social/blog2social.php Passed 13 tests

Analyzing the main PHP file in "Blog2Social: Social Media Auto Post & Scheduler" version 6.9.4
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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin67,486 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
PHP891,80580223,353
JavaScript452,26475918,354
CSS351,12814513,824
PO File54,4195,76511,667
SVG100288

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,157)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 338)
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity125.81
▷ Minimum class complexity1.00
▷ Maximum class complexity1,157.00
Average method complexity12.35
▷ Minimum method complexity1.00
▷ Maximum method complexity338.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes00.00%
Methods528
▷ Static methods8015.15%
▷ Public methods42881.06%
▷ Protected methods91.70%
▷ Private methods9117.23%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants66
▷ Global constants66100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
112 PNG files occupy 1.35MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/prg/post-icon.png0.61KB0.85KB0.00%
assets/images/features/licenses.png9.54KB2.97KB▼ 68.82%
assets/images/settings/b2s-post-format-24-2-en.png16.24KB8.29KB▼ 48.92%
assets/images/portale/2_flat.png6.22KB2.07KB▼ 66.67%
assets/images/portale/9_flat.png5.79KB1.97KB▼ 65.94%