84% facebook-auto-publish

Code Review | WP2Social Auto Publish

WordPress plugin WP2Social Auto Publish scored84%from 54 tests.

About plugin

  • Plugin page: facebook-auto-pub...
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 6, 2013
  • Latest release: Nov 7, 2023
  • Number of updates: 62
  • Update frequency: every 59.9 days
  • Top authors: f1logic (100%)

Code review

54 tests

User reviews

641 reviews

Install metrics

10,000+ active /938,196 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.28MB] [CPU: ▼7.60ms] Passed 4 tests

A check of server-side resources used by WP2Social Auto Publish
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3041.47 ▼2.20
Dashboard /wp-admin3.59 ▲0.2448.88 ▼12.90
Posts /wp-admin/edit.php3.71 ▲0.3555.53 ▲6.45
Add New Post /wp-admin/post-new.php6.19 ▲0.3084.40 ▼16.47
Media Library /wp-admin/upload.php3.52 ▲0.2840.45 ▲1.19
Settings /wp-admin/admin.php?page=facebook-auto-publish-settings3.8840.10
Suggest a Feature /wp-admin/admin.php?page=facebook-auto-publish-suggest-feature3.5334.24
Logs /wp-admin/admin.php?page=facebook-auto-publish-log3.5032.80
About /wp-admin/admin.php?page=facebook-auto-publish-about3.7538.43

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 165 new files
Database: no new tables, 39 new options
New WordPress options
xyz_fbap_application_secret
xyz_fbap_app_sel_mode
xyz_fbap_application_id
widget_theysaidso_widget
xyz_fbap_post_logs
xyz_fbap_dnt_shw_notice
xyz_credit_link
widget_recent-posts
xyz_fbap_premium_version_ads
xyz_fbap_pages_ids
...

Browser metrics Passed 4 tests

Checking browser requirements for WP2Social Auto Publish
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7114.36 ▲0.011.61 ▼0.1243.13 ▲1.51
Dashboard /wp-admin2,238 ▲645.60 ▲0.0093.66 ▼9.0488.24 ▲44.35
Posts /wp-admin/edit.php2,146 ▲461.97 ▲0.0136.72 ▲0.2034.23 ▲3.19
Add New Post /wp-admin/post-new.php1,716 ▲19021.96 ▼1.69711.89 ▲47.4754.20 ▲3.71
Media Library /wp-admin/upload.php1,443 ▲464.11 ▼0.11115.73 ▲8.3843.81 ▼2.09
Settings /wp-admin/admin.php?page=facebook-auto-publish-settings1,8391.7930.11135.72
Suggest a Feature /wp-admin/admin.php?page=facebook-auto-publish-suggest-feature1,1161.6623.1537.10
Logs /wp-admin/admin.php?page=facebook-auto-publish-log1,1311.6525.8035.30
About /wp-admin/admin.php?page=facebook-auto-publish-about2,1841.6525.9647.30

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • xyz_fbap_premium_version_ads
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • xyz_credit_link

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 42× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\HttpClients\\FacebookHttpClientInterface' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStreamHttpClient.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FileUpload\\FacebookFile' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookVideo.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\Collection' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphNode.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\PseudoRandomString\\PseudoRandomStringGeneratorInterface' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\Http\\RequestBodyInterface' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyMultipart.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Exceptions\\FacebookSDKException' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookServerException.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\Collection' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEdge.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Helpers\\FacebookSignedRequestFromInputHelper' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookCanvasHelper.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphGroup.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Helpers\\FacebookSignedRequestFromInputHelper' not found in wp-content/plugins/facebook-auto-publish/vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookJavaScriptHelper.php:31

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 uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can take inspiration from this readme.txt

facebook-auto-publish/facebook-auto-publish.php 92% from 13 tests

The main PHP file in "WP2Social Auto Publish" ver. 2.4.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 262 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected18,531 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP1011,5355,9169,120
PO File92,2672,3585,988
SVG1002,671
CSS213411616
JSON200104
JavaScript14023
XML1007
Markdown1102

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.99
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces12
Interfaces5
Traits1
Classes71
▷ Abstract classes11.41%
▷ Concrete classes7098.59%
▷ Final classes00.00%
Methods528
▷ Static methods203.79%
▷ Public methods48391.48%
▷ Protected methods264.92%
▷ Private methods193.60%
Functions43
▷ Named functions3990.70%
▷ Anonymous functions49.30%
Constants27
▷ Global constants518.52%
▷ Class constants2281.48%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
23 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/suggest.png3.30KB0.85KB▼ 74.28%
images/tick.png0.91KB0.87KB▼ 4.30%
images/xyz_logo.png9.26KB3.02KB▼ 67.36%
images/twitter-logo.png3.37KB0.94KB▼ 72.07%
images/pause.png6.80KB4.51KB▼ 33.71%