first commit

This commit is contained in:
Rachit Bhargava
2023-07-21 17:12:10 -04:00
parent d0fe47dde4
commit 5d0f0734d8
14003 changed files with 2829464 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
/**
* WPSEO Premium plugin file.
*
* @package WPSEO\Premium\Classes\Export\Views
*/
$yoast_seo_button_label = __( 'Export keyphrases', 'wordpress-seo-premium' );
$yoast_seo_csv_export_explain = sprintf(
/* translators: %s resolves to the button label translation. */
esc_html__(
'If you need a list of all public posts, terms and related keyphrases, you can generate a CSV file using the %s button below.',
'wordpress-seo-premium'
),
sprintf( '<code>%s</code>', esc_html( $yoast_seo_button_label ) )
);
?>
<div id="keywords-export" class="wpseotab">
<h2><?php esc_html_e( 'Export keyphrases to a CSV file', 'wordpress-seo-premium' ); ?></h2>
<p><?php echo $yoast_seo_csv_export_explain; /* phpcs:ignore WordPress.Security.EscapeOutput -- See above. */ ?></p>
<p><?php esc_html_e( 'You can add or remove columns to be included in the export using the checkboxes below.', 'wordpress-seo-premium' ); ?></p>
<form action="" method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<?php
wp_nonce_field( 'wpseo-export', '_wpnonce', true );
$yoast_seo_export_fields = [
'export-keywords-score' => __( 'Export keyphrase scores', 'wordpress-seo-premium' ),
'export-url' => __( 'Export URL', 'wordpress-seo-premium' ),
'export-title' => __( 'Export title', 'wordpress-seo-premium' ),
'export-seo-title' => __( 'Export SEO title', 'wordpress-seo-premium' ),
'export-meta-description' => __( 'Export meta description', 'wordpress-seo-premium' ),
'export-readability-score' => __( 'Export readability score', 'wordpress-seo-premium' ),
];
foreach ( $yoast_seo_export_fields as $yoast_seo_export_field_name => $yoast_seo_export_field_label ) {
echo '<input class="checkbox double" type="checkbox" id="' . esc_attr( $yoast_seo_export_field_name ) . '" name="wpseo[' . esc_attr( $yoast_seo_export_field_name ) . ']" value="on" checked="checked" />';
$yform->label( esc_html( $yoast_seo_export_field_label ), [ 'for' => $yoast_seo_export_field_name ] );
echo '<br class="clear" />';
}
?>
<br class="clear">
<input type="submit" class="button button-primary" name="export-posts" value="<?php echo esc_attr( $yoast_seo_button_label ); ?>"/>
</form>
<p><strong><?php esc_html_e( 'Please note:', 'wordpress-seo-premium' ); ?></strong></p>
<ul>
<li><?php esc_html_e( 'The first row in this file is the header row. This row should be ignored when parsing or importing the data from the export.', 'wordpress-seo-premium' ); ?></li>
<li><?php esc_html_e( 'Exporting data can take a long time when there are many posts, pages, public custom post types or terms.', 'wordpress-seo-premium' ); ?></li>
</ul>
</div>

View File

@@ -0,0 +1,17 @@
<?php
/**
* WPSEO Premium plugin file.
*
* @package WPSEO\Premium\Views
*/
?>
<div id="export-redirects" class="wpseotab">
<h2><?php esc_html_e( 'Export redirects to a CSV file', 'wordpress-seo-premium' ); ?></h2>
<p><?php esc_html_e( 'If you need to have a list of all redirects, you can generate a CSV file using the button below.', 'wordpress-seo-premium' ); ?></p>
<p><?php esc_html_e( 'Please note that the first row in this file is a header. This row should be ignored when parsing or importing the data from the export.', 'wordpress-seo-premium' ); ?></p>
<form action="" method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<?php wp_nonce_field( 'wpseo-export', '_wpnonce', true ); ?>
<input type="submit" class="button button-primary" name="export" value="<?php esc_attr_e( 'Export redirects', 'wordpress-seo-premium' ); ?>"/>
</form>
</div>

View File

@@ -0,0 +1,54 @@
<?php
/**
* WPSEO Premium plugin file.
*
* This is the view for the modal box that appears when the url can be added as a redirect.
*
* @package WPSEO\Admin|Google_Search_Console
*
* @uses string $url The old URL that redirects to the new URL.
*/
_deprecated_file( __FILE__, 'WPSEO 12.5' );
$yoast_seo_unique_id = md5( $url );
$yoast_seo_redirect_types = new WPSEO_Redirect_Types();
$yoast_seo_i18n_fixed_in_gsc = sprintf(
/* Translators: %1$s: expands to 'Google Search Console'. */
__( 'Mark this issue as fixed in %1$s.', 'wordpress-seo-premium' ),
'Google Search Console'
);
?>
<h1 class="wpseo-redirect-url-title"><?php esc_html_e( 'Redirect this broken URL and fix the error', 'wordpress-seo-premium' ); ?></h1>
<div class='form-field form-required'>
<label for='<?php echo esc_attr( 'wpseo-current-url-' . $yoast_seo_unique_id ); ?>'><?php esc_html_e( 'Old URL:', 'wordpress-seo-premium' ); ?></label>
<input type='text' id='<?php echo esc_attr( 'wpseo-current-url-' . $yoast_seo_unique_id ); ?>' name='current_url' value='<?php echo esc_url( $url ); ?>' readonly />
</div>
<div class='form-field form-required'>
<label for='<?php echo esc_attr( 'wpseo-redirect-type-' . $yoast_seo_unique_id ); ?>'><?php echo esc_html_x( 'Type', 'noun', 'wordpress-seo-premium' ); ?></label>
<select name='redirect-type' id='<?php echo esc_attr( 'wpseo-redirect-type-' . $yoast_seo_unique_id ); ?>' class='select'>
<?php
// Loop through the redirect types.
foreach ( $yoast_seo_redirect_types->get() as $yoast_seo_redirect_type => $yoast_seo_redirect_desc ) {
echo '<option value="' . esc_attr( $yoast_seo_redirect_type ) . '">'
. esc_html( $yoast_seo_redirect_desc ) . '</option>' . "\n";
}
?>
</select>
</div>
<div class='form-field form-required form-field-target'>
<label for='<?php echo esc_attr( 'wpseo-new-url-' . $yoast_seo_unique_id ); ?>'><?php esc_html_e( 'New URL:', 'wordpress-seo-premium' ); ?></label>
<input type='text' id='<?php echo esc_attr( 'wpseo-new-url-' . $yoast_seo_unique_id ); ?>' name='new_url' value='' />
</div>
<div class='form-field form-required'>
<label for='<?php echo esc_attr( 'wpseo-mark-as-fixed-' . $yoast_seo_unique_id ); ?>' class='clear'><?php esc_html_e( 'Mark as fixed:', 'wordpress-seo-premium' ); ?></label>
<input type='checkbox' checked value='1' id='<?php echo esc_attr( 'wpseo-mark-as-fixed-' . $yoast_seo_unique_id ); ?>' name='mark_as_fixed' class='clear' aria-describedby='<?php echo esc_attr( 'wpseo-mark-as-fixed-desc-' . $yoast_seo_unique_id ); ?>' />
<p id='<?php echo esc_attr( 'wpseo-mark-as-fixed-desc-' . $yoast_seo_unique_id ); ?>'><?php echo esc_html( $yoast_seo_i18n_fixed_in_gsc ); ?></p>
</div>
<p class='submit'>
<input type='button' name='submit' id='<?php echo esc_attr( 'submit-' . $yoast_seo_unique_id ); ?>' class='button button-primary' value='<?php esc_attr_e( 'Create redirect', 'wordpress-seo-premium' ); ?>' onclick='wpseoPostRedirectToGSC( jQuery( this ) );' />
<button type="button" class="button wpseo-redirect-close"><?php esc_html_e( 'Cancel', 'wordpress-seo-premium' ); ?></button>
</p>

View File

@@ -0,0 +1,38 @@
<?php
/**
* WPSEO Premium plugin file.
*
* This is the view for the modal box, when the url is already redirected.
*
* @package WPSEO\Admin|Google_Search_Console
*
* @uses WPSEO_Redirect $redirect Instance of the WPSEO_Redirect class, containing data about the existing redirect.
* @uses string $url The old URL that redirects to the new URL.
*/
_deprecated_file( __FILE__, 'WPSEO 12.5' );
?>
<h1 class="wpseo-redirect-url-title"><?php esc_html_e( 'Error: a redirect for this URL already exists', 'wordpress-seo-premium' ); ?></h1>
<p>
<?php
// There is no target.
if ( in_array( $redirect->get_type(), [ WPSEO_Redirect_Types::DELETED, WPSEO_Redirect_Types::UNAVAILABLE ], true ) ) {
printf(
/* Translators: %1$s: expands to the current URL. */
esc_html__( 'You do not have to create a redirect for URL %1$s because a redirect already exists. If this is fine you can mark this issue as fixed. If not, please go to the redirects page and change the redirect.', 'wordpress-seo-premium' ),
'<code>' . esc_url( $url ) . '</code>'
);
}
else {
printf(
/* Translators: %1$s: expands to the current URL and %2$s expands to URL the redirects points to. */
esc_html__( 'You do not have to create a redirect for URL %1$s because a redirect already exists. The existing redirect points to %2$s. If this is fine you can mark this issue as fixed. If not, please go to the redirects page and change the target URL.', 'wordpress-seo-premium' ),
'<code>' . esc_url( $url ) . '</code>',
'<code>' . esc_url( $redirect->get_target() ) . '</code>'
);
}
?>
</p>
<button type="button" class="button wpseo-redirect-close"><?php esc_html_e( 'Close', 'wordpress-seo-premium' ); ?></button>

View File

@@ -0,0 +1,77 @@
<?php
/**
* WPSEO Premium plugin file.
*
* @package WPSEO\Premium\Views
*
* @uses stdClass $import The import result object.
*/
$yoast_seo_i18n_import_redirects_from = sprintf(
/* translators: %s: '.htaccess' file name */
__( 'Import redirects from %s', 'wordpress-seo-premium' ),
'<code>.htaccess</code>'
);
$yoast_seo_i18n_import_redirects_explain = sprintf(
/* translators: %1$s: '.htaccess' file name, %2$s: plugin name */
__( 'You can copy the contents of any %1$s file in here, and it will import the redirects into %2$s.', 'wordpress-seo-premium' ),
'<code>.htaccess</code>',
'Yoast SEO Premium'
);
// The plugins we have import functions for.
$yoast_seo_plugins = [
'redirection' => __( 'Redirection', 'wordpress-seo-premium' ) . '<br/>',
'safe_redirect_manager' => __( 'Safe Redirect Manager', 'wordpress-seo-premium' ) . '<br/>',
'simple-301-redirects' => __( 'Simple 301 Redirects', 'wordpress-seo-premium' ) . '<br/>',
];
?>
<div id="import-htaccess" class="wpseotab">
<div>
<?php if ( ! empty( $import->msg ) ) : ?>
<div class="yoast-alert notice <?php echo ( $import->success ) ? 'notice-success' : 'notice-error'; ?>">
<p><?php echo $import->msg; ?></p>
</div>
<?php endif; ?>
<h2><?php esc_html_e( 'Import from other redirect plugins', 'wordpress-seo-premium' ); ?></h2>
<form action="" method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<?php wp_nonce_field( 'wpseo-import', '_wpnonce', true ); ?>
<?php
Yoast_Form::get_instance()->radio( 'import_plugin', $yoast_seo_plugins, __( 'Import from:', 'wordpress-seo-premium' ) );
?>
<br/>
<input type="submit" class="button button-primary" name="import" value="<?php esc_attr_e( 'Import redirects', 'wordpress-seo-premium' ); ?>"/>
</form>
</div>
<br/>
<div>
<h2><?php esc_html_e( 'Import from a CSV file', 'wordpress-seo-premium' ); ?></h2>
<form enctype="multipart/form-data" action="" method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<?php wp_nonce_field( 'wpseo-import', '_wpnonce', true ); ?>
<p>
<label for="redirects_csv_file"><?php esc_html_e( 'Choose a CSV file from your computer:', 'wordpress-seo-premium' ); ?></label><br/>
<input type="file" name="redirects_csv_file" id="redirects_csv_file"/>
</p>
<input type="submit" class="button button-primary" name="import_csv" value="<?php esc_attr_e( 'Import CSV file', 'wordpress-seo-premium' ); ?>"/>
</form>
</div>
<br/>
<div>
<h2><?php echo wp_kses( $yoast_seo_i18n_import_redirects_from, [ 'code' => [] ] ); ?></h2>
<p>
<?php echo wp_kses( $yoast_seo_i18n_import_redirects_explain, [ 'code' => [] ] ); ?>
</p>
<form action="" method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
<?php wp_nonce_field( 'wpseo-import', '_wpnonce', true ); ?>
<label for="htaccess" class="screen-reader-text"><?php esc_html_e( 'Enter redirects to import', 'wordpress-seo-premium' ); ?></label>
<textarea name="htaccess" id="htaccess" rows="15" class="large-text code"></textarea><br/>
<input type="submit" class="button button-primary" name="import" value="<?php esc_attr_e( 'Import .htaccess', 'wordpress-seo-premium' ); ?>"/>
</form>
</div>
</div>