78% jetpack-social

Code Review | Jetpack Social

WordPress plugin Jetpack Social scored78%from 54 tests.

About plugin

  • Plugin page: jetpack-social
  • Plugin version: 2.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: May 31, 2022
  • Latest release: Sep 20, 2023
  • Number of updates: 123
  • Update frequency: every 4.1 days
  • Top authors: jetpackisbestpack (60.98%)pabline (11.38%)siddarthan (6.5%)zinigor (5.69%)danielpost (5.69%)

Code review

54 tests

User reviews

32 reviews

Install metrics

20,000+ active /288,063 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.61MB] [CPU: ▲5.64ms] 75% from 4 tests

An overview of server-side resources used by Jetpack Social
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,011.30ms on /wp-admin/admin.php?page=my-jetpack)
PageMemory (MB)CPU Time (ms)
Home /7.28 ▲3.8146.47 ▲3.33
Dashboard /wp-admin5.80 ▲2.4561.28 ▲0.78
Posts /wp-admin/edit.php5.91 ▲2.5562.99 ▲11.29
Add New Post /wp-admin/post-new.php8.82 ▲2.93113.94 ▲7.15
Media Library /wp-admin/upload.php5.72 ▲2.4956.38 ▲17.54
Social /wp-admin/admin.php?page=jetpack-social5.8654.26
My Jetpack /wp-admin/admin.php?page=my-jetpack6.531,011.30

Server storage [IO: ▲5.50MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 369 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
jetpack_sync_settings_disable
widget_recent-comments
jetpack_connection_active_plugins
jetpack_sync_https_history_home_url
theysaidso_admin_options
jetpack_sync_https_history_site_url
...

Browser metrics Passed 4 tests

A check of browser resources used by Jetpack Social
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7414.37 ▼0.182.73 ▲1.1139.22 ▼3.00
Dashboard /wp-admin2,242 ▲625.67 ▲0.0793.46 ▲4.8338.82 ▲0.54
Posts /wp-admin/edit.php2,147 ▲472.22 ▲0.2040.34 ▲3.3331.53 ▼2.40
Add New Post /wp-admin/post-new.php1,547 ▲2123.33 ▲0.27618.36 ▼67.6556.71 ▼0.62
Media Library /wp-admin/upload.php1,446 ▲464.30 ▲0.10100.60 ▼3.4442.91 ▼1.96
Social /wp-admin/admin.php?page=jetpack-social1,31212.83287.5145.52
My Jetpack /wp-admin/admin.php?page=my-jetpack1,24410.06158.9738.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 12 options in the database
    • jetpack_options
    • can_compress_scripts
    • jetpack_connection_active_plugins
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • jetpack-social_activated
    • widget_recent-comments
    • db_upgraded
    • jetpack_sync_https_history_site_url
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 61× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Hybrid_Product' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-boost.php:16
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jpc4802e05bbcf59fd3b6350e8d3e5482c_social\xe2\x93\xa52_3_0\\wp_normalize_path() in wp-content/plugins/jetpack-social/vendor/jetpack-autoloader/class-path-processor.php:73
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce-hpos-orders.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-sync/src/modules/class-woocommerce.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Publicize\\Publicize_Base' not found in wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=my-jetpack
    • > Network (severe)
    index.php/wp-json/my-jetpack/v1/site/purchases?_locale=user - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

jetpack-social/jetpack-social.php Passed 13 tests

The main PHP file in "Jetpack Social" ver. 2.3.0 adds more information about the plugin and also serves as the entry point for this plugin
101 characters long description:
Share your site’s posts on several social media networks automatically when you publish a new post.

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 detected43,969 lines of code in 300 files:
LanguageFilesBlank linesComment linesLines of code
PHP2147,36224,52533,790
Markdown252,03706,646
JSON24002,558
Sass38216442
JavaScript1644120396
SVG71377
JSX17350
CSS100010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity24.15
▷ Minimum class complexity1.00
▷ Maximum class complexity294.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces24
Interfaces3
Traits0
Classes187
▷ Abstract classes52.67%
▷ Concrete classes18297.33%
▷ Final classes00.00%
Methods2,256
▷ Static methods78134.62%
▷ Public methods2,01689.36%
▷ Protected methods964.26%
▷ Private methods1446.38%
Functions57
▷ Named functions610.53%
▷ Anonymous functions5189.47%
Constants170
▷ Global constants95.29%
▷ Class constants16194.71%
▷ Public constants161100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 1.35MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/connect-f27775ac15cf885713c2.png60.55KB35.14KB▼ 41.96%
jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png23.54KB25.93KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png92.66KB101.40KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png25.35KB28.14KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png142.02KB55.29KB▼ 61.07%