-
Notifications
You must be signed in to change notification settings - Fork 1
EP-4812: Refactor to Add Ads Enabled Option #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,11 +77,6 @@ protected function updateSettings() { | |
| } | ||
|
|
||
| // Organic Settings | ||
| $this->organic->updateOption( | ||
| 'organic::enabled', | ||
| isset( $_POST['organic_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
Comment on lines
-80
to
-84
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Enabled" will be offloaded to WordPress, i.e., plugin is activated or deactivated. If activated, we will now have more granular options about what, exactly, is enabled, e.g., Ads, Affiliate, etc.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, see #183 (comment) |
||
| $this->organic->updateOption( | ||
| 'organic::test_mode', | ||
| isset( $_POST['organic_test_mode'] ) ? true : false, | ||
|
|
@@ -136,21 +131,6 @@ protected function updateSettings() { | |
| false | ||
| ); | ||
|
|
||
| // Organic Affiliate | ||
| $this->organic->updateOption( | ||
| 'organic::affiliate_enabled', | ||
| isset( $_POST['organic_affiliate_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| // Organic Campaigns | ||
| $this->organic->updateOption( | ||
| 'organic::campaigns_enabled', | ||
| isset( $_POST['organic_campaigns_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| // Organic Ads | ||
| $this->organic->updateOption( | ||
| 'organic::feed_images', | ||
| isset( $_POST['organic_feed_images'] ) ? true : false, | ||
|
|
@@ -168,16 +148,36 @@ protected function updateSettings() { | |
| ); | ||
| $this->organic->setPostTypes( $val ); | ||
|
|
||
| // Organic Ads | ||
| $this->organic->updateOption( | ||
| 'organic::ads_enabled', | ||
| isset( $_POST['organic_ads_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| $this->organic->updateOption( | ||
| 'organic::content_foreground', | ||
| isset( $_POST['organic_content_foreground'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| // Organic Affiliate | ||
| $this->organic->updateOption( | ||
| 'organic::affiliate_enabled', | ||
| isset( $_POST['organic_affiliate_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| // Organic Campaigns | ||
| $this->organic->updateOption( | ||
| 'organic::campaigns_enabled', | ||
| isset( $_POST['organic_campaigns_enabled'] ) ? true : false, | ||
| false | ||
| ); | ||
|
|
||
| } | ||
|
|
||
| public function showSettings() { | ||
| $enabled = $this->organic->getOption( 'organic::enabled' ); | ||
| $test_mode = $this->organic->getOption( 'organic::test_mode' ); | ||
| $organic_test = $this->organic->getOption( 'organic::percent_test' ); | ||
| $organic_value = $this->organic->getOption( 'organic::test_value' ); | ||
|
|
@@ -190,6 +190,8 @@ public function showSettings() { | |
| $ad_slots_prefill_enabled = $this->organic->getOption( 'organic::ad_slots_prefill_enabled' ); | ||
| $log_to_sentry = $this->organic->getOption( 'organic::log_to_sentry', true ); | ||
|
|
||
| $ads_enabled = $this->organic->getOption( 'organic::ads_enabled' ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means that after the plugin upgrade, the Ads will become disabled because the If the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, thank you! |
||
|
|
||
| $affiliate_enabled = $this->organic->getOption( 'organic::affiliate_enabled' ); | ||
|
|
||
| $campaigns_enabled = $this->organic->getOption( 'organic::campaigns_enabled' ); | ||
|
|
@@ -217,16 +219,6 @@ public function showSettings() { | |
| <h1>Organic Settings</h1> | ||
| <form method="post"> | ||
| <?php wp_nonce_field( 'organic_settings_nonce' ); ?> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_enabled" | ||
| <?php echo $enabled ? 'checked' : ''; ?> | ||
| > | ||
| Organic Integration Enabled | ||
| </label> | ||
| </p> | ||
| <p> | ||
| <label> | ||
| <input | ||
|
|
@@ -336,76 +328,87 @@ class="organic-wide-input" | |
| Automatically send plugin errors to Organic | ||
| </label> | ||
| </p> | ||
|
|
||
| <hr /> | ||
| <h2>Organic Affiliate</h2> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_affiliate_enabled" | ||
| <?php echo $affiliate_enabled ? 'checked' : ''; ?> | ||
| type="checkbox" | ||
| name="organic_feed_images" | ||
| <?php echo $feed_images ? 'checked' : ''; ?> | ||
| /> | ||
| Organic Affiliate Enabled | ||
| Inject Images into RSS Feed (for Connatix Playspace player) | ||
| </label> | ||
| </p> | ||
|
|
||
| <hr /> | ||
| <h2>Organic Campaigns</h2> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_campaigns_enabled" | ||
| <?php echo $campaigns_enabled ? 'checked' : ''; ?> | ||
| type="checkbox" | ||
| name="organic_enable_ads_txt_redirect" | ||
| <?php echo $ads_txt_redirect ? 'checked' : ''; ?> | ||
| /> | ||
| Organic Campaigns Enabled | ||
| Ads.txt Redirect Enabled | ||
| </label> | ||
| </p> | ||
| <hr /> | ||
| <h2>Content Sync Settings</h2> | ||
| <fieldset> | ||
| <p> | ||
| Which post types from your CMS should be treated as content for synchronization with | ||
| the Organic Platform and as eligible for the Organic SDK to be loaded on? | ||
| <ul> | ||
| <?php $this->injectPostTypesList(); ?> | ||
| </ul> | ||
| </p> | ||
|
|
||
| </fieldset> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_content_foreground" | ||
| <?php echo $content_foreground ? 'checked' : ''; ?> | ||
| /> | ||
| Force content sync on Save (use only if CRON is disabled on your site) | ||
| </label> | ||
| </p> | ||
| <hr /> | ||
| <h2>Organic Ads</h2> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_feed_images" | ||
| <?php echo $feed_images ? 'checked' : ''; ?> | ||
| type="checkbox" | ||
| name="organic_ads_enabled" | ||
| <?php echo $ads_enabled ? 'checked' : ''; ?> | ||
| /> | ||
| Inject Images into RSS Feed (for Connatix Playspace player) | ||
| Organic Ads Enabled | ||
| </label> | ||
| </p> | ||
| <hr /> | ||
| <h2>Organic Affiliate</h2> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_enable_ads_txt_redirect" | ||
| <?php echo $ads_txt_redirect ? 'checked' : ''; ?> | ||
| name="organic_affiliate_enabled" | ||
| <?php echo $affiliate_enabled ? 'checked' : ''; ?> | ||
| /> | ||
| Ads.txt Redirect Enabled | ||
| Organic Affiliate Enabled | ||
| </label> | ||
| </p> | ||
|
|
||
| <hr /> | ||
| <h2>Organic Campaigns</h2> | ||
| <p> | ||
| <label> | ||
| <input | ||
| type="checkbox" | ||
| name="organic_content_foreground" | ||
| <?php echo $content_foreground ? 'checked' : ''; ?> | ||
| name="organic_campaigns_enabled" | ||
| <?php echo $campaigns_enabled ? 'checked' : ''; ?> | ||
| /> | ||
| Force content sync on Save (use only if CRON is disabled on your site) | ||
| Organic Campaigns Enabled | ||
| </label> | ||
| </p> | ||
| <fieldset> | ||
| <p> | ||
| Which post types from your CMS should be treated as content for synchronization with | ||
| the Organic Platform and as eligible for the Organic SDK to be loaded on? | ||
| <ul> | ||
| <?php $this->injectPostTypesList(); ?> | ||
| </ul> | ||
| </p> | ||
|
|
||
| </fieldset> | ||
|
|
||
| <hr /> | ||
| <p> | ||
| <button type="submit" name="organic_action" value="organic_update_settings"> | ||
| Save settings | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,7 +144,7 @@ public function register_organic_types() { | |
| $adsConfig = $organic->getAdsConfig(); | ||
| $testEnabled = $organic->useSplitTest(); | ||
| return [ | ||
| 'organicEnabled' => $organic->isEnabledAndConfigured(), | ||
| 'organicEnabled' => $organic->isConfigured(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now, a lot of Recurrent sites do have Organic WP plugin enabled and configured in WP, but the "integration" checkbox is disabled That's because Organic Web has a hard dependency on Organic WP plugin GQL API and they can't just disable/delete the whole plugin And by passing the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I see. I wonder if we can modify the language or add plugin field descriptions to make this all clearer? As a client looking at the settings page, I would be extremely confused. What does it mean for the integration to be enabled--isn't the plugin already active? If it's enabled but Ads, Affiliate, and Campaigns are not, then what is the plugin doing? Etc. Tagging @cjkie here too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For instance, I wonder if something like this taxonomy would work: General Settings
SDK and Content Sync
Organic Ads
Organic Affiliate
Organic Campaigns
|
||
| 'sdkVersion' => $organic->getSdkVersion(), | ||
| 'siteDomain' => $organic->siteDomain, | ||
| 'siteId' => $organic->getSiteId(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Ads needs to be enabled, but maybe not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(E.g., maybe similar to Ads.txt redirect not needing Ads enabled)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it worth syncing to make sure we have config before enabling Ads