Skip to content
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

Fix Yoast SEO Link Checker Conflict #1848 #1852

Merged
merged 5 commits into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 77 additions & 54 deletions includes/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,60 +73,6 @@ function give_run_install() {
// Setup some default options.
$options = array();

// Checks if the Success Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'success_page' ) ) ) {

// Donation Confirmation (Success) Page
$success = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation Confirmation', 'give' ),
'post_content' => '[give_receipt]',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

// Store our page IDs
$options['success_page'] = $success;
}

// Checks if the Failure Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'failure_page' ) ) ) {

// Failed Donation Page
$failed = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation Failed', 'give' ),
'post_content' => esc_html__( 'We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give' ),
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

$options['failure_page'] = $failed;
}

// Checks if the History Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'history_page' ) ) ) {
// Donation History Page
$history = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation History', 'give' ),
'post_content' => '[donation_history]',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

$options['history_page'] = $history;
}

//Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency.
if ( empty( $current_version ) ) {
$options = array_merge( $options, give_get_default_settings() );
Expand Down Expand Up @@ -417,3 +363,80 @@ function give_get_default_agreement_text() {

return apply_filters( 'give_get_default_agreement_text', $agreement, $org_name );
}


/**
* This function will install give related page which is not created already.
*
* @since 1.8.11
*/
function give_create_pages(){

// Bailout if pages already created.
if( get_option( 'give_install_pages_created') ) {
return false;
}

$options = array();

// Checks if the Success Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'success_page' ) ) ) {

// Donation Confirmation (Success) Page
$success = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation Confirmation', 'give' ),
'post_content' => '[give_receipt]',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

// Store our page IDs
$options['success_page'] = $success;
}

// Checks if the Failure Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'failure_page' ) ) ) {

// Failed Donation Page
$failed = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation Failed', 'give' ),
'post_content' => esc_html__( 'We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give' ),
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

$options['failure_page'] = $failed;
}

// Checks if the History Page option exists AND that the page exists.
if ( ! get_post( give_get_option( 'history_page' ) ) ) {
// Donation History Page
$history = wp_insert_post(
array(
'post_title' => esc_html__( 'Donation History', 'give' ),
'post_content' => '[donation_history]',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'page',
'comment_status' => 'closed'
)
);

$options['history_page'] = $history;
}

if( ! empty( $options ) ) {
update_option( 'give_settings', array_merge( give_get_settings(), $options ) );
}

add_option( 'give_install_pages_created', 1, '', 'no' );
}
add_action( 'admin_init', 'give_create_pages', -1 );
52 changes: 28 additions & 24 deletions languages/give.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ msgstr ""
msgid "Nonce verification failed."
msgstr ""

#: includes/admin/donors/donor-actions.php:492, includes/login-register.php:254, includes/process-donation.php:538, includes/process-donation.php:712, includes/user-functions.php:359
#: includes/admin/donors/donor-actions.php:492, includes/login-register.php:254, includes/process-donation.php:549, includes/process-donation.php:723, includes/user-functions.php:359
msgid "Invalid email."
msgstr ""

Expand Down Expand Up @@ -1705,7 +1705,7 @@ msgstr ""
msgid "Search"
msgstr ""

#: includes/admin/payments/class-payments-table.php:245, includes/admin/tools/logs/class-sales-logs-list-table.php:307, includes/class-give-html-elements.php:398
#: includes/admin/payments/class-payments-table.php:245, includes/admin/tools/logs/class-sales-logs-list-table.php:308, includes/class-give-html-elements.php:398
msgid "All"
msgstr ""

Expand Down Expand Up @@ -1761,7 +1761,7 @@ msgstr ""
msgid "via"
msgstr ""

#: includes/admin/payments/class-payments-table.php:365, includes/admin/shortcodes/abstract-shortcode-generator.php:296, includes/admin/tools/logs/class-sales-logs-list-table.php:74, includes/admin/tools/logs/class-sales-logs-list-table.php:310, includes/class-give-html-elements.php:137, includes/forms/widget.php:155
#: includes/admin/payments/class-payments-table.php:365, includes/admin/shortcodes/abstract-shortcode-generator.php:296, includes/admin/tools/logs/class-sales-logs-list-table.php:74, includes/admin/tools/logs/class-sales-logs-list-table.php:311, includes/class-give-html-elements.php:137, includes/forms/widget.php:155
msgid "Untitled (#%s)"
msgstr ""

Expand Down Expand Up @@ -5910,7 +5910,7 @@ msgstr ""
msgid "Your password"
msgstr ""

#: includes/forms/template.php:1297, includes/process-donation.php:655, templates/shortcode-login.php:40
#: includes/forms/template.php:1297, includes/process-donation.php:666, templates/shortcode-login.php:40
msgid "Reset Password"
msgstr ""

Expand Down Expand Up @@ -6222,11 +6222,11 @@ msgstr ""
msgid "We're sorry, your donation failed to process. Please try again or contact site support."
msgstr ""

#: includes/login-register.php:111, includes/process-donation.php:653
#: includes/login-register.php:111, includes/process-donation.php:664
msgid "The password you entered is incorrect."
msgstr ""

#: includes/login-register.php:114, includes/process-donation.php:676
#: includes/login-register.php:114, includes/process-donation.php:687
msgid "The username you entered does not exist."
msgstr ""

Expand Down Expand Up @@ -6658,75 +6658,79 @@ msgstr ""
msgid "You are logged in as %1$s, and are submitting a donation as %2$s, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address."
msgstr ""

#: includes/process-donation.php:273
#: includes/process-donation.php:238
msgid "Welcome %s! You have successfully logged into your account."
msgstr ""

#: includes/process-donation.php:284
msgid "Honeypot field detected. Go away bad bot!"
msgstr ""

#: includes/process-donation.php:338
#: includes/process-donation.php:349
msgid "Please insert a valid donation amount."
msgstr ""

#: includes/process-donation.php:347
#: includes/process-donation.php:358
msgid "This form has a minimum donation amount of %s."
msgstr ""

#: includes/process-donation.php:360
#: includes/process-donation.php:371
msgid "The selected payment gateway is not enabled."
msgstr ""

#: includes/process-donation.php:410, includes/scripts.php:66
#: includes/process-donation.php:421, includes/scripts.php:66
msgid "You must agree to the terms and conditions."
msgstr ""

#: includes/process-donation.php:431, includes/scripts.php:62
#: includes/process-donation.php:442, includes/scripts.php:62
msgid "Please enter a valid email address."
msgstr ""

#: includes/process-donation.php:435, includes/scripts.php:61
#: includes/process-donation.php:446, includes/scripts.php:61
msgid "Please enter your first name."
msgstr ""

#: includes/process-donation.php:444
#: includes/process-donation.php:455
msgid "Please enter your primary billing address."
msgstr ""

#: includes/process-donation.php:448
#: includes/process-donation.php:459
msgid "Please enter your zip / postal code."
msgstr ""

#: includes/process-donation.php:452
#: includes/process-donation.php:463
msgid "Please enter your billing city."
msgstr ""

#: includes/process-donation.php:456
#: includes/process-donation.php:467
msgid "Please select your billing country."
msgstr ""

#: includes/process-donation.php:460
#: includes/process-donation.php:471
msgid "Please enter billing state / province."
msgstr ""

#: includes/process-donation.php:542
#: includes/process-donation.php:553
msgid "The user information is invalid."
msgstr ""

#: includes/process-donation.php:631, includes/user-functions.php:319
#: includes/process-donation.php:642, includes/user-functions.php:319
msgid "You must register or login to complete your donation."
msgstr ""

#: includes/process-donation.php:672, includes/scripts.php:64, includes/user-functions.php:401
#: includes/process-donation.php:683, includes/scripts.php:64, includes/user-functions.php:401
msgid "Enter a password."
msgstr ""

#: includes/process-donation.php:701
#: includes/process-donation.php:712
msgid "You must be logged in to donate."
msgstr ""

#: includes/process-donation.php:725, includes/user-functions.php:354
#: includes/process-donation.php:736, includes/user-functions.php:354
msgid "Enter an email."
msgstr ""

#: includes/process-donation.php:898
#: includes/process-donation.php:909
msgid "The zip / postal code you entered for your billing address is invalid."
msgstr ""

Expand Down
Loading