• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
    • Help
      • Online help
      • Learn Git
      • Welcome to Bitbucket
      • Keyboard shortcuts
    • Log In
    Blackrock
    1. Blackrock

    main

    Public
    Actions
    • Clone

    Learn more about cloning repositories

    You have read-only access

    Navigation
    • Source
    • Commits
    • Branches
    • All Branches Graph
    • Graphs
    • Forks
    1. Blackrock
    2. main

    Source

    main/wp-content/plugins/seo-by-rank-math/includes/settings/general/htaccess.php
    Артем ШиряевАртем Ширяев committed 554847ddcb906 Apr 2021
    Raw file
    Source viewDiff to previous
    ​x
     
    1
    <?php
    2
    /**
    3
     * The htaccess settings.
    4
     *
    5
     * @package    RankMath
    6
     * @subpackage RankMath\Settings
    7
     */
    8
    ​
    9
    use RankMath\Admin\Admin_Helper;
    10
    use RankMath\Helper;
    11
    ​
    12
    defined( 'ABSPATH' ) || exit;
    13
    ​
    14
    $data = Admin_Helper::get_htaccess_data();
    15
    ​
    16
    if ( false === $data ) {
    17
        $cmb->add_field(
    18
            [
    19
                'id'      => 'htaccess_not_found',
    20
                'type'    => 'notice',
    21
                'what'    => 'error',
    22
                'content' => esc_html__( '.htaccess file not found.', 'rank-math' ),
    23
            ]
    24
        );
    25
        return;
    26
    }
    27
    ​
    28
    $attrs = [
    29
        'value'    => $data['content'],
    30
        'readonly' => 'readonly',
    31
    ];
    32
    ​
    33
    if ( ! $data['writable'] || ! Helper::is_edit_allowed() ) {
    34
        $cmb->add_field(
    35
            [
    36
                'id'      => 'htaccess_not_writable',
    37
                'type'    => 'notice',
    38
                'what'    => 'error',
    39
                'content' => esc_html__( '.htaccess file is not writable.', 'rank-math' ),
    40
            ]
    41
        );
    42
    } else {
    43
    ​
    44
        $consent_checkbox = '<br><br><label><input type="checkbox" name="htaccess_accept_changes" id="htaccess_accept_changes" value="1"> <strong>' . esc_html__( 'I understand the risks and I want to edit the file', 'rank-math' ) . '</strong></label>';
    45
    ​
    46
        $cmb->add_field(
    47
            [
    48
                'id'      => 'htaccess_accept_changes',
    49
                'type'    => 'notice',
    50
                'what'    => 'error',
    51
                'content' => wp_kses_post( __( 'Be careful when editing the htaccess file, it is easy to make mistakes and break your site. If that happens, you can restore the file to its state <strong>before the last edit</strong> by replacing the htaccess file with the backup copy created by Rank Math in the same directory (<em>.htaccess_back_xxxxxx</em>) using an FTP client.', 'rank-math' ) ) . $consent_checkbox,
    52
                'classes' => 'rank-math-notice',
    53
            ]
    54
        );
    55
    }
    56
    $cmb->add_field(
    57
        [
    58
            'id'         => 'htaccess_content',
    59
            'type'       => 'textarea',
    60
            'classes'    => 'rank-math-code-box',
    61
            'save_field' => false,
    62
            'attributes' => $attrs,
    63
        ]
    64
    );
    • Git repository management for enterprise teams powered by Atlassian Bitbucket
    • Atlassian Bitbucket v5.10.1
    • Documentation
    • Contact Support
    • Request a feature
    • About
    • Contact Atlassian
    Atlassian

    Everything looks good. Well let you know here if theres anything you should know about.