Skip to content

Conversation

@manzoorwanijk
Copy link
Member

@manzoorwanijk manzoorwanijk commented Jan 7, 2026

Fixes SOCIAL-270

Proposed changes:

  • Remove the logic related to share limits and shares data which is no longer used.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Do a sanity check for Social admin page and the editor for Simple, Jetpack, and Atomic sites.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the remove/social/sharing-limits-logic branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack remove/social/sharing-limits-logic

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control
Copy link

jp-launch-control bot commented Jan 7, 2026

Code Coverage Summary

Coverage changed in 6 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/js-packages/publicize-components/src/components/admin-page/header/index.js 7/7 (100.00%) 0.00% 0 💚
projects/js-packages/publicize-components/src/social-store/hydrate-stores.ts 16/17 (94.12%) -0.62% 0 💚
projects/packages/publicize/src/class-publicize-script-data.php 0/96 (0.00%) 0.00% -3 💚
projects/plugins/social/src/class-jetpack-social.php 45/80 (56.25%) 2.76% -5 💚
projects/packages/publicize/src/class-publicize-base.php 210/592 (35.47%) 0.93% -16 💚

Full summary · PHP report · JS report

@manzoorwanijk manzoorwanijk force-pushed the remove/social/sharing-limits-logic branch 3 times, most recently from 5d48ad3 to 38b8443 Compare January 7, 2026 09:47
@manzoorwanijk manzoorwanijk force-pushed the remove/social/sharing-limits-logic branch from 38b8443 to cb42cfd Compare January 7, 2026 09:53
@manzoorwanijk manzoorwanijk requested a review from a team January 7, 2026 10:30
@manzoorwanijk manzoorwanijk added the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jan 7, 2026
@manzoorwanijk manzoorwanijk marked this pull request as ready for review January 7, 2026 10:30
Copilot AI review requested due to automatic review settings January 7, 2026 10:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes the obsolete share limits logic and UI from Jetpack Social. The changes comprehensively eliminate all functionality related to enforcing sharing limits for free-tier users.

Key Changes

  • Removed share limits enforcement logic and related PHP classes (Share_Limits, Shares_Data_Controller)
  • Removed JavaScript/TypeScript components and selectors for displaying share usage statistics
  • Cleaned up REST API endpoints, test files, and webpack configurations related to share limits

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/plugins/social/src/class-jetpack-social.php Removed get_shares_info() and calculate_scheduled_shares() methods
projects/plugins/social/tests/php/Jetpack_Social_Test.php Updated tests to remove mocking of deleted calculate_scheduled_shares() method
projects/packages/publicize/src/class-share-limits.php Deleted entire class handling share limit enforcement
projects/packages/publicize/src/rest-api/class-shares-data-controller.php Deleted REST API controller for shares data
projects/packages/publicize/tests/php/Share_Limits_Test.php Deleted unit tests for share limits
projects/packages/publicize/src/class-publicize-setup.php Removed init_sharing_limits() method and controller registration
projects/packages/publicize/src/class-publicize-script-data.php Removed get_shares_data() method and unused Jetpack_Options import
projects/packages/publicize/src/class-publicize-base.php Removed get_publicize_shares_info() and calculate_scheduled_shares() methods
projects/packages/publicize/webpack.config.js Removed classic-editor-share-limits entry point
projects/packages/publicize/src/js/classic-editor-share-limits.js Deleted classic editor share limits JavaScript
projects/js-packages/publicize-components/src/types.ts Removed SharesData type definition
projects/js-packages/publicize-components/src/social-store/types.ts Removed duplicate SharesData type definition
projects/js-packages/publicize-components/src/social-store/selectors/shares-data.ts Deleted selectors for share limit data
projects/js-packages/publicize-components/src/social-store/selectors/index.ts Removed import of deleted shares data selectors
projects/js-packages/publicize-components/src/social-store/hydrate-stores.ts Removed entity registration for publicize/shares-data
projects/js-packages/publicize-components/src/components/admin-page/header/index.js Removed stat cards display and related imports/selectors
projects/js-packages/publicize-components/src/components/admin-page/header/stat-cards/ Deleted entire stat cards component directory
projects/js-packages/publicize-components/src/utils/test-utils.js Removed shares_data from mock script data
.phan/baseline.php files Updated static analysis baselines to reflect removed code
changelog/ files Added changelog entries documenting the removal

Copy link
Contributor

@gmjuhasz gmjuhasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I sanity tested it on my test sites and didn't run into any issues

@manzoorwanijk manzoorwanijk merged commit de60474 into trunk Jan 8, 2026
81 checks passed
@manzoorwanijk manzoorwanijk deleted the remove/social/sharing-limits-logic branch January 8, 2026 12:46
@github-actions github-actions bot removed [Status] In Progress [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants