<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[مەکۆکانی وێبچن - یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
	<link rel="self" href="https://www.webchin.org/Meko/extern.php?action=feed&amp;tid=34060&amp;type=atom" />
	<updated>2017-03-13T03:18:30Z</updated>
	<generator>PunBB</generator>
	<id>https://www.webchin.org/Meko/viewtopic.php?id=34060</id>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264301#p264301" />
			<content type="html"><![CDATA[<p><h2><span style="color: #fb0000">سوپاس بۆ ئێوە بەزیات کردنی چەند دێرێک کۆد بۆ فاڵی login-form.php کارەکە جێبەجێبوو&nbsp; </span></h2><br /></p><div class="codebox"><pre><code data-language=php>&lt;?php
/**
 * This file is part of the Subway WordPress Plugin Package.
 *
 * (c) Joseph Gabito &lt;joseph@useissuestabinstead.com&gt;
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 * 
 * PHP Version 5.4
 * 
 * @category Subway\Templates
 * @package  Subway
 * @author   Joseph G. &lt;emailnotdisplayed@domain.tld&gt;
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version  GIT:github.com/codehaiku/subway
 * @link     github.com/codehaiku/subway The Plugin Repository
 */

if ( ! defined( &#039;ABSPATH&#039; ) ) {
    return;
}

$args = array(
    &#039;echo&#039;           =&gt; true,
    &#039;form_id&#039;        =&gt; &#039;loginform&#039;,
    &#039;label_username&#039; =&gt; __( &#039;Username&#039;, &#039;subway&#039; ),
    &#039;label_password&#039; =&gt; __( &#039;Password&#039;, &#039;subway&#039; ),
    &#039;label_remember&#039; =&gt; __( &#039;Remember Me&#039;, &#039;subway&#039; ),
    &#039;label_log_in&#039;   =&gt; __( &#039;Log In&#039;, &#039;subway&#039; ),
    &#039;id_username&#039;    =&gt; &#039;user_login&#039;,
    &#039;id_password&#039;    =&gt; &#039;user_pass&#039;,
    &#039;id_remember&#039;    =&gt; &#039;rememberme&#039;,
    &#039;id_submit&#039;      =&gt; &#039;wp-submit&#039;,
    &#039;remember&#039;       =&gt; true,
    &#039;value_username&#039; =&gt; &#039;&#039;,
    &#039;value_remember&#039; =&gt; false,
    &#039;redirect&#039;          =&gt; home_url(),
);

$error_login_message = &#039;&#039;;

$message_types = array();

$http_request_login = filter_input( INPUT_GET, &#039;login&#039;, FILTER_SANITIZE_SPECIAL_CHARS );

$http_request_type = filter_input( INPUT_GET, &#039;type&#039;, FILTER_SANITIZE_SPECIAL_CHARS );

$http_request_logout = filter_input( INPUT_GET, &#039;loggedout&#039;, FILTER_SANITIZE_SPECIAL_CHARS );

if ( isset( $http_request_login ) ) {

    if ( &#039;failed&#039; === $http_request_login ) {

        if ( isset( $http_request_type ) ) {

            $message_types = array(

                &#039;default&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;There was an error trying to sign-in to your account. Make sure the credentials below are correct.&#039;, &#039;subway&#039; ),
                    ),
                &#039;__blank&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Required: Username and Password cannot be empty.&#039;, &#039;subway&#039; ),
                    ),
                &#039;__userempty&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Required: Username cannot be empty.&#039;, &#039;subway&#039; ),
                    ),
                &#039;__passempty&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Required: Password cannot be empty.&#039;, &#039;subway&#039; ),
                    ),
                &#039;fb_invalid_email&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Facebook email address is invalid or is not yet verified.&#039;, &#039;subway&#039; ),
                    ),
                &#039;fb_error&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Facebook Application Error. Misconfigured or App is rejected.&#039;, &#039;subway&#039; ),
                    ),
                &#039;app_not_live&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Unable to fetch your Facebook Profile.&#039;, &#039;subway&#039; ),
                    ),
                &#039;gears_username_or_email_exists&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Username or email address already exists&#039;, &#039;subway&#039; ),
                    ),
                &#039;gp_error_authentication&#039; =&gt; array(
                        &#039;message&#039; =&gt; __( &#039;Google Plus Authentication Error. Invalid Client ID or Secret.&#039;, &#039;subway&#039; ),
                    ),
            );

            $message = $message_types[&#039;default&#039;][&#039;message&#039;];

            if ( array_key_exists( $http_request_type, $message_types ) ) {

                $message = $message_types[ $http_request_type ][&#039;message&#039;];

            }

            $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&#039; . esc_html( $message ) . &#039;&lt;/div&gt;&#039;;

        } else {

            $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&#039; . esc_html__( &#039;Error: Invalid username and password combination.&#039;, &#039;subway&#039; ) . &#039;&lt;/div&gt;&#039;;

        }
    }
}

if ( isset( $http_request_logout ) ) {
    $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;success&quot;&gt;&#039; . esc_html__( &#039;You have logged out successfully.&#039;, &#039;subway&#039; ) . &#039;&lt;/div&gt;&#039;;
}

$http_request_redirected = filter_input( INPUT_GET, &#039;_redirected&#039;, FILTER_SANITIZE_SPECIAL_CHARS );

if ( isset( $http_request_redirected ) ) {
    $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;success&quot;&gt;&#039; . esc_html__( &#039;Members only page. Please use the login form below to access the page.&#039;, &#039;subway&#039; ) . &#039;&lt;/div&gt;&#039;;
}

?&gt;
&lt;?php if ( ! is_user_logged_in() ) { ?&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://www.w3schools.com/lib/w3.css&quot;&gt;


  &lt;a href=&quot;javascript:void(0)&quot; class=&quot;w3-dark-grey w3-button w3-hover-black w3-left-align&quot; onclick=&quot;document.getElementById(&#039;id01&#039;).style.display=&#039;block&#039;&quot;&gt;New Message &lt;i class=&quot;w3-padding-left fa fa-pencil&quot;&gt;&lt;/i&gt;&lt;/a&gt;

&lt;div id=&quot;id01&quot; class=&quot;w3-modal&quot; style=&quot;z-index:999999&quot;&gt;
  &lt;div class=&quot;w3-modal-content w3-animate-zoom&quot;&gt;
      &lt;h2&gt;&lt;/h2&gt;
    &lt;/div&gt;
    &lt;div class=&quot;w3-panel&quot;&gt;
    
    
    
    
    &lt;div class=&quot;mg-top-35 mg-bottom-35 subway-login-form&quot;&gt;
        &lt;div class=&quot;subway-login-form-form&quot;&gt;
            &lt;div class=&quot;subway-login-form__actions&quot;&gt;
                &lt;h3&gt;
                    &lt;?php esc_html_e( &#039;Account Sign-in&#039;, &#039;subway&#039; ); ?&gt;
                &lt;/h3&gt;
                &lt;?php do_action( &#039;gears_login_form&#039; ); ?&gt;
            &lt;/div&gt;
            &lt;div class=&quot;subway-login-form-message&quot;&gt;
                &lt;?php echo wp_kses_post( $error_login_message ); ?&gt;
            &lt;/div&gt;
            &lt;div class=&quot;subway-login-form__form&quot;&gt;
                &lt;?php echo wp_login_form( $args ); ?&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    
    
    
      &lt;div class=&quot;w3-section&quot;&gt;
      &lt;/div&gt;    
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;




&lt;?php } else { ?&gt;
    &lt;div class=&quot;mg-top-35 mg-bottom-35 subway-login-sucessfull&quot; style=&quot;background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;&quot;&gt;
        &lt;p style=&quot;margin-bottom: 0px;&quot;&gt;
            &lt;?php $success_message = apply_filters( &#039;subway_login_message_success&#039;, esc_html__( &#039;Great! You have succesfully login.&#039;, &#039;subway&#039; ) ); ?&gt;
            &lt;?php echo esc_html( $success_message ); ?&gt;
        &lt;/p&gt;
    &lt;/div&gt;
&lt;?php } ?&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-13T03:18:30Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264301#p264301</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264298#p264298" />
			<content type="html"><![CDATA[<p>a</p>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-13T00:31:05Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264298#p264298</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264281#p264281" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>xaly نووسی:</cite><blockquote><p>سووپاس کاکە ئاسۆ بەڵام دەمەوێت لەبڕی ئەوەی پەڕەیێک لەژێر ناوی ڕووکارەکە بکاتەوە بیبات بۆ پەڕەیێکی ئامادەکراووی phpجایا لە ڕووکارەکە</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-12T10:49:33Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264281#p264281</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264280#p264280" />
			<content type="html"><![CDATA[<p>.</p>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-12T10:48:01Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264280#p264280</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264279#p264279" />
			<content type="html"><![CDATA[<p>بەپێی ئەو README ـەی کە داتناوە نووسراوە لە&nbsp; <strong>Administration Panel (‘Settings’ &gt; &#039;Subway&#039;) </strong>دەتوانیت ئەو ڕێکخستنە دەستکاری بکەیت، جا سەیری ئەوێ بکە.</p>]]></content>
			<author>
				<name><![CDATA[ئاسۆ نادری]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=3</uri>
			</author>
			<updated>2017-03-12T09:51:22Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264279#p264279</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[وه‌ڵام: یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264278#p264278" />
			<content type="html"><![CDATA[<p>تکایە من هێشتا چاوەڕووانی وەڵامم</p>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-12T09:40:18Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264278#p264278</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[یارمەتی لە چاک کردنی پێوەکراوێک]]></title>
			<link rel="alternate" href="https://www.webchin.org/Meko/viewtopic.php?pid=264260#p264260" />
			<content type="html"><![CDATA[<p>من دەمەوێت پێوەکراوەکم ریک بخەم بەناوی subway کە کاری ئەوەیە میمبەرەکانی ماڵپەرەکەت ناچار بەچوونەژوورەوەدەکات کە پەریێکی ماڵپەرەکەت دەکاتەوە <h2>وەک</h2><br /><span class="postimg"><img src="http://www.webchinupload.com/f/2017-03/ba2f9391fd43772549e66a8a4d8a9bbe.PNG" alt="http://www.webchinupload.com/f/2017-03/ba2f9391fd43772549e66a8a4d8a9bbe.PNG" /></span></p><p><span style="color: #d43e08">کە لەبڕی پێشاندانی بابەتەکان فۆرمی چونەژورەوە پێشان دەدات دەمەویت لەبرێ ئەوی فۆرمیک لە فووکارەکەم بکاتەوە بروات بۆ wp-login.php</span></p><br /><p>ئەوە بەستەری پێوەکراوەکە<br /><a href="https://wordpress.org/plugins-wp/subway/">https://wordpress.org/plugins-wp/subway/</a></p><br /><br /><br /><br /><p>فایڵی&nbsp; &nbsp; functions.php</p><div class="codebox"><pre><code data-language=php>&lt;?php
/**
 * Includes all the file necessary for Subway.
 *
 * @package  Subway
 */

if ( ! defined( &#039;ABSPATH&#039; ) ) { die(); }

// Redirect the user when he/she visit wp-admin or wp-login.php.
add_action( &#039;init&#039;, &#039;subway_redirect_login&#039; );

// Redirect the user after successful logged in attempt.
add_filter( &#039;login_redirect&#039;, &#039;subway_redirect_user_after_logged_in&#039;, 10, 3 );

// Handle failed login redirection.
add_action( &#039;wp_login_failed&#039;, &#039;subway_redirect_login_handle_failure&#039; );

/**
 * Redirect all wp-login.php post
 * and get request to the user assigned log-in page
 *
 * @return void
 */
function subway_redirect_login() {

    // Only run this function when on wp-login.php.
    if ( ! in_array( $GLOBALS[&#039;pagenow&#039;], array( &#039;wp-login.php&#039; ), true ) ) {
        return;
    }

    // Bypass login if specified.
    $no_redirect = filter_input( INPUT_GET, &#039;no_redirect&#039;, FILTER_VALIDATE_BOOLEAN );

    // Bypass wp-login.php?action=*.
    $has_action = filter_input( INPUT_GET, &#039;action&#039;, FILTER_SANITIZE_STRING );

    // Has any errors?
    $has_error = filter_input( INPUT_GET, &#039;error&#039;, FILTER_SANITIZE_STRING );

    // Error Types.
    $has_type = filter_input( INPUT_GET, &#039;type&#039;, FILTER_SANITIZE_STRING );

    // Set the default to our login page.
    $redirect_page = subway_get_redirect_page_url();

    if ( $has_error &amp;&amp; $has_type ) {

        $redirect_to = add_query_arg( array(
                &#039;login&#039; =&gt; &#039;failed&#039;,
                &#039;type&#039; =&gt; $has_type,
        ), $redirect_page );

        wp_safe_redirect( esc_url_raw( $redirect_to ) );

        die();
    }

    // Bypass wp-login.php?action=* link.
    if ( $has_action ) {
        return;
    }

    if ( $no_redirect ) {
        return;
    }

    // Check if buddypress activate page.
    if ( function_exists( &#039;bp_is_activation_page&#039; ) ) {
        if ( bp_is_activation_page() ) {
            return;
        }
    }

    // Check if buddypress registration page.
    if ( function_exists( &#039;bp_is_register_page&#039; ) ) {
        if ( bp_is_register_page() ) {
            return;
        }
    }

    // Store for checking if this page equals wp-login.php.
    $curr_paged = basename( $_SERVER[&#039;REQUEST_URI&#039;] );

    if ( empty( $redirect_page ) ) {

        return;

    }

    // Ff user visits wp-admin or wp-login.php, redirect them.
    if ( strstr( $curr_paged, &#039;wp-login.php&#039; ) ) {

        if ( isset( $_GET[&#039;interim-login&#039;] ) ) {
            return;
        }

        // Check if there is an action present action might represent user trying to log out.
        if ( isset( $_GET[&#039;action&#039;] ) ) {

            $action = $_GET[&#039;action&#039;];

            if ( &#039;logout&#039; === $action ) {

                return;

            }
        }

        // Only redirect if there are no incoming post data.
        if ( empty( $_POST ) ) {
            wp_safe_redirect( $redirect_page );
        }

        // Redirect to error page if user left username and password blank.
        if ( ! empty( $_POST ) ) {

            if ( empty( $_POST[&#039;log&#039;] ) &amp;&amp; empty( $_POST[&#039;pwd&#039;] ) ) {
                $redirect_to = add_query_arg( array(
                        &#039;login&#039; =&gt; &#039;failed&#039;,
                        &#039;type&#039; =&gt; &#039;__blank&#039;,
                ), $redirect_page );

                wp_safe_redirect( esc_url_raw( $redirect_to ) );
            } elseif ( empty( $_POST[&#039;log&#039;] ) &amp;&amp; ! empty( $_POST[&#039;pwd&#039;] ) &amp;&amp; ! empty( $_POST[&#039;redirect_to&#039;] ) ) {
                // Username empty.
                $redirect_to = add_query_arg( array(
                        &#039;login&#039; =&gt; &#039;failed&#039;,
                        &#039;type&#039; =&gt; &#039;__userempty&#039;,
                ), $redirect_page );

                wp_safe_redirect( esc_url_raw( $redirect_to ) );
            } elseif ( ! empty( $_POST[&#039;log&#039;] ) &amp;&amp; empty( $_POST[&#039;pwd&#039;] ) &amp;&amp; ! empty( $_POST[&#039;redirect_to&#039;] ) ) {
                // Password empty.
                $redirect_to = add_query_arg( array(
                        &#039;login&#039; =&gt; &#039;failed&#039;,
                        &#039;type&#039; =&gt; &#039;__passempty&#039;,
                ), $redirect_page );

                wp_safe_redirect( esc_url_raw( $redirect_to ) );
            } else {

                // Generic.
                $redirect_to = add_query_arg( array(
                        &#039;login&#039; =&gt; &#039;failed&#039;,
                        &#039;type&#039; =&gt; &#039;default&#039;,
                ), $redirect_page );

                wp_safe_redirect( esc_url_raw( $redirect_to ) );
            }
        }
    }

    return;
}

/**
 * Redirects the user to selected page or custom url.
 *
 * @param  string $redirect_to &#039;login_redirect&#039; filter callback argument that holds the current $redirect_to value.
 * @param  object $request     &#039;login_redirect&#039; filter callback argument that holds request header.
 * @param  object $user        &#039;login_redirect&#039; filter callback argument that holds logged in user info.
 * @return string              The final redirection url
 */
function subway_redirect_user_after_logged_in( $redirect_to, $request, $user ) {

    $subway_redirect_type = get_option( &#039;subway_redirect_type&#039; );

    // Redirect the user to default behaviour if there are no redirect type option saved.
    if ( empty( $subway_redirect_type ) ) {

        return $redirect_to;

    }

    if ( &#039;default&#039; === $subway_redirect_type ) {
        return $redirect_to;
    }

    if ( &#039;page&#039; === $subway_redirect_type ) {

        // Get the page url of the selected page if the admin selected &#039;Custom Page&#039; in the redirect type settings.
        $selected_redirect_page = intval( get_option( &#039;subway_redirect_page_id&#039; ) );

        // Redirect to default WordPress behaviour if the user did not select page.
        if ( empty( $selected_redirect_page ) ) {

            return $redirect_to;
        }

        // Otherwise, get the permalink of the saved page and let the user go into that page.
        return get_permalink( $selected_redirect_page );

    } elseif ( &#039;custom_url&#039; === $subway_redirect_type ) {

        // Get the custom url saved in the redirect type settings.
        $entered_custom_url = get_option( &#039;subway_redirect_custom_url&#039; );

        // Redirect to default WordPress behaviour if the user did enter a custom url.
        if ( empty( $entered_custom_url ) ) {

            return $redirect_to;

        }

        // Otherwise, get the custom url saved and let the user go into that page.
        $current_user = wp_get_current_user();

        $entered_custom_url = str_replace( &#039;%user_id%&#039;, $user-&gt;ID, $entered_custom_url );

        $entered_custom_url = str_replace( &#039;%user_name%&#039;, $user-&gt;user_login, $entered_custom_url );

        return $entered_custom_url;

    }

    // Otherwise, quit and redirect the user back to default WordPress behaviour.
    return $redirect_to;
}

/**
 * Handles the failure login attempt from customized login page.
 *
 * @param  object $user WordPress callback function.
 * @return void
 */
function subway_redirect_login_handle_failure( $user ) {

    // Pull the sign-in page url.
    $sign_in_page = wp_login_url();

    $custom_sign_in_page_url = subway_get_redirect_page_url();

    if ( ! empty( $custom_sign_in_page_url ) ) {

        $sign_in_page = $custom_sign_in_page_url;

    }

    // Check that were not on the default login page.
    if ( ! empty( $sign_in_page ) &amp;&amp; ! strstr( $sign_in_page,&#039;wp-login&#039; ) &amp;&amp; ! strstr( $sign_in_page,&#039;wp-admin&#039; ) &amp;&amp; null !== $user ) {

        // make sure we don&#039;t already have a failed login attempt.
        if ( ! strstr( $sign_in_page, &#039;?login=failed&#039; ) ) {

            // Redirect to the login page and append a querystring of login failed.
            $permalink = add_query_arg( array(
                &#039;login&#039; =&gt; &#039;failed&#039;,
                &#039;type&#039; =&gt; &#039;default&#039;,
            ), $custom_sign_in_page_url );

              wp_safe_redirect( esc_url_raw( $permalink ) );

              die();

        } else {

              wp_safe_redirect( $sign_in_page );

              die();
        }

        return;
    }

    return;
}

/**
 * Helper function to return the user selected page
 * inside the &#039;Login&#039; under &#039;Reading&#039; settings
 *
 * @return void
 */
function subway_get_redirect_page_url() {

    $selected_login_post_id = intval( get_option( &#039;subway_login_page&#039; ) );

    if ( 0 === $selected_login_post_id ) {

        return;

    }

    $login_post = get_post( $selected_login_post_id );

    if ( ! empty( $login_post ) ) {

        return get_permalink( $login_post-&gt;ID );

    }

    return false;

}

function subway_integrate_login_form_filter( $contents ) {
    ob_start();
    do_action(&#039;login_form&#039;);
    return ob_get_clean() . $contents;
}</code></pre></div><br /><br /><br /><br /><br /><br /><p>فایڵی&nbsp; &nbsp;login-form.php</p><br /><div class="codebox"><pre><code data-language=php>&lt;?php
/**
 * The login for shortcode template
 *
 * @since 1.0
 */

if ( ! defined( &#039;ABSPATH&#039; ) ) { die(); }
/**
 * Callback function to register &#039;subway_login&#039;
 * shortcode in order to display the login form
 * inside the page using &#039;subway_login&#039; shortcode
 *
 * @param  array $atts shortcode callback attributes
 * @return string     output_buffer
 */


function subway_wp_login( $atts ) {

    // begin output buffering
    ob_start();

    $args = array(
        &#039;echo&#039;           =&gt; true,
        &#039;form_id&#039;        =&gt; &#039;loginform&#039;,
        &#039;label_username&#039; =&gt; __( &#039;Username&#039;, &#039;subway&#039; ),
        &#039;label_password&#039; =&gt; __( &#039;Password&#039;, &#039;subway&#039; ),
        &#039;label_remember&#039; =&gt; __( &#039;Remember Me&#039;, &#039;subway&#039; ),
        &#039;label_log_in&#039;   =&gt; __( &#039;Log In&#039;, &#039;subway&#039; ),
        &#039;id_username&#039;    =&gt; &#039;user_login&#039;,
        &#039;id_password&#039;    =&gt; &#039;user_pass&#039;,
        &#039;id_remember&#039;    =&gt; &#039;rememberme&#039;,
        &#039;id_submit&#039;      =&gt; &#039;wp-submit&#039;,
        &#039;remember&#039;       =&gt; true,
        &#039;value_username&#039; =&gt; &#039;&#039;,
        &#039;value_remember&#039; =&gt; false,
        &#039;redirect&#039;          =&gt; home_url(),
    );

    $error_login_message = &#039;&#039;;

    $message_types = array();

    add_filter(&#039;login_form_middle&#039;, &#039;subway_integrate_login_form_filter&#039;);

    if ( isset( $_GET[&#039;login&#039;] ) ) {

        if ( &#039;failed&#039; === $_GET[&#039;login&#039;] ) {

            if ( isset( $_GET[&#039;type&#039;] ) ) {

                $message_types = array(

                    &#039;default&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;There was an error trying to sign-in to your account. Make sure the credentials below are correct.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;__blank&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Required: Username and Password cannot be empty.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;__userempty&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Required: Username cannot be empty.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;__passempty&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Required: Password cannot be empty.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;fb_invalid_email&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Facebook email address is invalid or is not yet verified.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;fb_error&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Facebook Application Error. Misconfigured or App is rejected.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;app_not_live&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Unable to fetch your Facebook Profile.&#039;, &#039;subway&#039; ),
                        ),
                    &#039;gears_username_or_email_exists&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Username or email address already exists&#039;, &#039;subway&#039; ),
                        ),
                    &#039;gp_error_authentication&#039; =&gt; array(
                            &#039;message&#039; =&gt; __( &#039;Google Plus Authentication Error. Invalid Client ID or Secret.&#039;, &#039;subway&#039; ),
                        ),
                );

                $message = $message_types[&#039;default&#039;][&#039;message&#039;];

                if ( array_key_exists( $_GET[&#039;type&#039;], $message_types ) ) {

                    $message = $message_types[ $_GET[&#039;type&#039;] ][&#039;message&#039;];

                }

                $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&#039;. esc_html( $message ) .&#039;&lt;/div&gt;&#039;;

            } else {

                $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&#039;.__( &#039;Error: Invalid username and password combination.&#039;, &#039;subway&#039; ).&#039;&lt;/div&gt;&#039;;

            }
        }
    }

    if ( isset( $_GET[&#039;_redirected&#039;] ) ) {
        $error_login_message = &#039;&lt;div id=&quot;message&quot; class=&quot;success&quot;&gt;&#039;.__( &#039;Oops! Looks like you need to login in order to view the page.&#039;, &#039;subway&#039; ).&#039;&lt;/div&gt;&#039;;
    }

    ?&gt;
    &lt;?php if ( ! is_user_logged_in() ) { ?&gt;
        &lt;div class=&quot;mg-top-35 mg-bottom-35 subway-login-form&quot;&gt;
            &lt;div class=&quot;subway-login-form-form&quot;&gt;
                &lt;div class=&quot;subway-login-form__actions&quot;&gt;
                    &lt;h3&gt;
                        &lt;?php _e( &#039;Account Sign-in&#039;, &#039;subway&#039; ); ?&gt;
                    &lt;/h3&gt;
                    &lt;?php do_action( &#039;gears_login_form&#039; ); ?&gt;
                &lt;/div&gt;
                &lt;div class=&quot;subway-login-form-message&quot;&gt;
                    &lt;?php echo $error_login_message; ?&gt;
                &lt;/div&gt;
                &lt;div class=&quot;subway-login-form__form&quot;&gt;
                    &lt;?php echo wp_login_form( $args ); ?&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;?php } else { ?&gt;
        &lt;div class=&quot;mg-top-35 mg-bottom-35 subway-login-sucessfull&quot; style=&quot;background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;&quot;&gt;
            &lt;p style=&quot;margin-bottom: 0px;&quot;&gt;
                &lt;?php echo esc_html__( apply_filters( &#039;subway_login_message&#039;, &#039;Great! You have succesfully login.&#039; ), &#039;subway&#039; ); ?&gt;
            &lt;/p&gt;
        &lt;/div&gt;
    &lt;?php } ?&gt;
    &lt;script&gt;

    jQuery(document).ready(function($){

        &quot;use strict&quot;;

        $(window).load( function(){

            var $input = $(&#039;.subway-login-form__form p &gt; input&#039;);

            if ( $input.val().length &gt;= 1 ) {
                $input.prev(&#039;label&#039;).addClass(&#039;inactive&#039;);
            }

        });

        $(&#039;.subway-login-form__form p &gt; input&#039;).focusin(function(){
            $(this).prev(&#039;label&#039;).addClass(&#039;inactive&#039;);
        }).focusout(function(){
            if ( $(this).val().length &lt; 1 ) {
                $(this).prev(&#039;label&#039;).removeClass(&#039;inactive&#039;);
            }
        });
    });
    &lt;/script&gt;
    &lt;?php

    return ob_get_clean();

}

add_action( &#039;login_form_middle&#039;, &#039;subway_add_lost_password_link&#039; );

function subway_add_lost_password_link() {

    return &#039;&lt;p class=&quot;subway-login-lost-password&quot;&gt;&lt;a href=&quot;&#039;.esc_url( wp_lostpassword_url( $redirect = &#039;&#039; ) ).&#039;&quot;&gt;&#039; . __( &#039;Forgot Password&#039;, &#039;subway&#039; ) . &#039;&lt;/a&gt;&lt;/p&gt;&#039;;

}

/**
 * callback function to &#039;init&#039; hook to register
 * @return  void
 */
function subway_register_shortcode() {

    add_shortcode( &#039;subway_login&#039;, &#039;subway_wp_login&#039; );

    return;
}

add_action( &#039;init&#039;, &#039;subway_register_shortcode&#039; );
?&gt;</code></pre></div><br /><br /><br /><br /><p>فایڵی&nbsp; &nbsp; private.php</p><br /><div class="codebox"><pre><code data-language=php>&lt;?php
/**
 * This file contains the logic for our redirection
 *
 * @package subway
 */

if ( ! defined( &#039;ABSPATH&#039; ) ) { die();
}

// Check if publitize is enabled inside theme option.
// Redirect all pages to login page except for selected page.
$subway_publitize_web = intval( get_option( &#039;subway_is_public&#039; ) );

if ( 1 !== $subway_publitize_web ) {
    add_action( &#039;wp&#039;, &#039;subway_redirect_to_login&#039; );
}

/**
 * Redirects all the pages except for few selected pages inside
 * the reading settings
 *
 * (Front-end General)
 *
 * @return void
 */
function subway_redirect_to_login() {
    
    session_start();

    global $post;

    $post_copy = &amp;$post;

    $login_page_id = intval( get_option( &#039;subway_login_page&#039; ) );

    $excluded_page = subway_get_excluded_page_id_collection();

    // Already escaped inside &#039;subway_get_redirect_page_url&#039;.
    $redirect_page = subway_get_redirect_page_url();

    // Check if redirect page is empty or not.
    if ( empty( $redirect_page ) ) {
        return;
    }

    // Check if buddypress activate page.
    if ( function_exists( &#039;bp_is_activation_page&#039; ) ) {
        if ( bp_is_activation_page() ) {
            return;
        }
    }

    // Check if buddypress registration page.
    if ( function_exists( &#039;bp_is_register_page&#039; ) ) {
        if ( bp_is_register_page() ) {
            return;
        }
    }

    // Assign 0 value to empty $post-&gt;ID to prevent exception.
    // This applies to custom WordPress pages such as BP Members Page and Groups.
    if ( empty( $post_copy ) ) {
        $post_copy = new stdclass;
        $post_copy-&gt;ID = 0;
    }

    $current_page_id = intval( $post_copy-&gt;ID );

    // Check if $current_page_id &amp;&amp; $selected_blog_id is equal to each other.
    // If that is the case, get the page ID instead of global $post-&gt;ID that the query returns.
    // The ID of the first post object inside the loop is not correct.
    $blog_id = intval( get_option( &#039;page_for_posts&#039; ) );

    if ( is_home() ) {
        if ( $blog_id === $login_page_id ) {
            $current_page_id = $blog_id;
        }
    }

    
    if ( isset( $_SESSION[&#039;redirected&#039;] ) )  {
        
        unset( $_SESSION[&#039;redirected&#039;] );
        
        return;

    }
    
    // Only execute the script for non-loggedin visitors.
    if ( ! is_user_logged_in() ) {

        if ( $current_page_id !== $login_page_id ) {
            
            if ( ! in_array( $current_page_id, $excluded_page, true ) ) {
                
                $_SESSION[&#039;redirected&#039;] = true;
                
                wp_safe_redirect( add_query_arg( array( &#039;_redirected&#039; =&gt; &#039;yes&#039; ), $redirect_page ) );

                die();

            }
        }
    }

    return;

}

/**
 * Helper function to get the ID collection of all
 * the selected pages inside the reading settings.
 *
 * @return array the formatted version of pages ID separated by comma
 */
function subway_get_excluded_page_id_collection() {

    $subway_public_post = get_option( &#039;subway_public_post&#039; );

    $excluded_pages_collection = array();

    if ( ! empty( $subway_public_post ) ) {

        $excluded_pages_collection = explode( &#039;,&#039;, $subway_public_post );

    }

    // Should filter it by integer, spaces will be ignored, other strings.
    // Will be converted to zero &#039;0&#039;.
    return array_filter( array_map( &#039;intval&#039;, $excluded_pages_collection ) );

}

add_action( &#039;admin_init&#039;, &#039;subway_settings_api_init&#039; );

/**
 * Register all the settings inside &#039;Reading&#039; section
 * of WordPress Administration Panel
 *
 * @return void
 */
function subway_settings_api_init() {

    // Add new &#039;Pages Visibility Settings&#039;.
    add_settings_section(
        &#039;subway_setting_section&#039;,
        __( &#039;Pages Visibility Settings&#039;, &#039;subway&#039; ),
        &#039;subway_setting_section_callback_function&#039;,
        &#039;reading&#039;
    );

    // WP Options &#039;subway_public_post&#039;.
    add_settings_field(
        &#039;subway_public_post&#039;,
        __( &#039;Public Posts IDs&#039;, &#039;subway&#039; ),
        &#039;subway_setting_callback_function&#039;,
        &#039;reading&#039;,
        &#039;subway_setting_section&#039;
    );

    // WP Options &#039;subway_is_public&#039;.
    add_settings_field(
        &#039;subway_is_public&#039;,
        __( &#039;Public Website&#039;, &#039;subway&#039; ),
        &#039;subway_is_public_form&#039;,
        &#039;reading&#039;,
        &#039;subway_setting_section&#039;
    );

    // WP Options &#039;subway_login_page&#039;.
    add_settings_field(
        &#039;subway_login_page&#039;,
        __( &#039;Login Page&#039;, &#039;subway&#039; ),
        &#039;subway_login_page_form&#039;,
        &#039;reading&#039;,
        &#039;subway_setting_section&#039;
    );

    // WP Options &#039;subway_redirect_type&#039;.
    add_settings_field(
        &#039;subway_redirect_type&#039;,
        __( &#039;Redirect Type&#039;, &#039;subway&#039; ),
        &#039;subway_redirect_option_form&#039;,
        &#039;reading&#039;,
        &#039;subway_setting_section&#039;
    );

    // WP Options &#039;subway_bypassing_info&#039;.
    add_settings_field(
        &#039;subway_bypassing_info&#039;,
        __( &#039;Bypassing Redirect&#039;, &#039;subway&#039; ),
        &#039;subway_bypassing_option_form&#039;,
        &#039;reading&#039;,
        &#039;subway_setting_section&#039;
    );

    // Register all the callback settings id.
    register_setting( &#039;reading&#039;, &#039;subway_public_post&#039; );
    register_setting( &#039;reading&#039;, &#039;subway_is_public&#039; );
    register_setting( &#039;reading&#039;, &#039;subway_login_page&#039; );
    register_setting( &#039;reading&#039;, &#039;subway_redirect_type&#039; );

    register_setting( &#039;reading&#039;, &#039;subway_redirect_page_id&#039; );
    register_setting( &#039;reading&#039;, &#039;subway_redirect_custom_url&#039; );

}


/**
 * Register a callback function that will handle
 * the &#039;Pages Visibility Settings&#039; Page.
 *
 * @return void
 */
function subway_setting_section_callback_function() {
    // Do nothing.
    return;
}

/**
 * Callback function for &#039;subway_public_post&#039; setting.
 *
 * @return void
 */
function subway_setting_callback_function() {

    echo &#039;&lt;textarea id=&quot;subway_public_post&quot; name=&quot;subway_public_post&quot; rows=&quot;5&quot; cols=&quot;95&quot;&gt;&#039; . esc_attr( trim( get_option( &#039;subway_public_post&#039; ) ) ) . &#039;&lt;/textarea&gt;&#039;;

    echo &#039;&lt;p class=&quot;description&quot;&gt;&#039; . nl2br( esc_html( &quot;Enter the IDs of posts and pages that you wanted to show in public. You need to separate it by &#039;,&#039; (comma),  \nfor example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the option below.&quot;, &#039;subway&#039; ) ) . &#039;&lt;/p&gt;&#039;;

    return;
}

/**
 * Callback function for &#039;subway_is_public&#039; setting
 *
 * @return void
 */
function subway_is_public_form() {

    echo &#039;&lt;label for=&quot;subway_is_public&quot;&gt;&lt;input &#039; . checked( 1, get_option( &#039;subway_is_public&#039; ), false ) . &#039; value=&quot;1&quot; name=&quot;subway_is_public&quot; id=&quot;subway_is_public&quot; type=&quot;checkbox&quot; class=&quot;code&quot; /&gt; Check to make all of your posts and pages visible to public.&lt;/label&gt;&#039;;
    echo &#039;&lt;p class=&quot;description&quot;&gt;&#039; . esc_html__( &#039;Pages like user profile, members, and groups are still only available to the rightful owner of the profile.&#039;, &#039;subway&#039; ) . &#039;&lt;/p&gt;&#039;;

    return;
}

/**
 * Callback function for &#039;subway_login_page&#039; setting
 *
 * @return void
 */
function subway_login_page_form() {

    $subway_login_page_id = intval( get_option( &#039;subway_login_page&#039; ) );

    if ( ! empty( $subway_login_page_id ) ) {

        $login_page_object = get_post( $subway_login_page_id );

        if ( ! empty( $login_page_object )  &amp;&amp; isset( $login_page_object-&gt;post_content ) ) {

            // Automatically prepend the login shortcode if no
            // Shortcode exists in the selected login page.
            if ( ! has_shortcode( $login_page_object-&gt;post_content, &#039;subway_login&#039; ) ) {

                $new_post_object = array(
                  &#039;ID&#039; =&gt; $login_page_object-&gt;ID,
                  &#039;post_content&#039; =&gt; &#039;[subway_login] &#039; . $login_page_object-&gt;post_content,// Prepend Only.
                 );

                wp_update_post( $new_post_object );
            }
        }
    }

    wp_dropdown_pages(
        array(
        &#039;name&#039; =&gt; &#039;subway_login_page&#039;,
        &#039;selected&#039; =&gt; intval( $subway_login_page_id ),
        &#039;show_option_none&#039; =&gt; esc_html__( &#039;---&#039;, &#039;subway&#039; ),
        )
    );

    echo &#039;&lt;p class=&quot;description&quot;&gt;&#039; . sprintf( esc_html__( &#039;Select a page to use as a login page for your website. Select a login page and save the changes to make your site private. Leave blank to make your site public. %1$s.&#039;, &#039;subway&#039; ), &#039;&lt;span style=&quot;font-weight: bold; color: #ad4a4a;&quot;&gt;&#039; . esc_html__( &#039;You need to add &quot;[subway_login]&quot; shortcode in the selected page to show the login form (this is automatic)&#039;, &#039;subway&#039; ) ) . &#039;&lt;/span&gt;&lt;/p&gt;&#039;;

    return;
}

/**
 * Callback function for &#039;subway_bypassing_info&#039; setting
 *
 * @return void
 */
function subway_bypassing_option_form() {

    echo &quot;&lt;p class=&#039;description&#039;&gt;&quot;;

    echo sprintf(

        __(
            &quot;Use the following link to bypass the log-in page 
        and go directly to your website&#039;s wp-login URL (http://yoursiteurl.com/wp-login.php): 
        &lt;br&gt;&lt;br&gt; &lt;strong&gt;%s&lt;/strong&gt;&quot;, &#039;subway&#039;
        ),
        site_url( &#039;wp-login.php?no_redirect=true&#039; )
    );

    echo &#039;&lt;/p&gt;&#039;;

    return;
}

/**
 * Callback function for &#039;subway_redirect_option&#039; setting.
 *
 * @return void
 */
function subway_redirect_option_form() {
    ?&gt;

    &lt;style&gt;
        
        .subway-redirect-option-section {
            background: #fff;
            padding: 15px 20px;
            margin: 15px 0;
        }

    &lt;/style&gt;
    
    &lt;p class=&quot;subway-redirect-type-choices&quot;&gt;

        &lt;!-- Page --&gt;
        &lt;label for=&quot;subway_use_page&quot;&gt;
            
            &lt;input &lt;?php checked( &#039;page&#039;, get_option( &#039;subway_redirect_type&#039; ), true ); ?&gt; value=&quot;page&quot; name=&quot;subway_redirect_type&quot; id=&quot;subway_use_page&quot; type=&quot;radio&quot; class=&quot;code&quot; /&gt; 
            
    &lt;?php esc_html_e( &#039;Custom Page&#039;, &#039;subway&#039; ); ?&gt;

        &lt;/label&gt;

        &lt;!-- Custom URL --&gt;

        &amp;nbsp;&amp;nbsp;&amp;nbsp;

        &lt;label for=&quot;subway_use_custom_url&quot;&gt;
            
            &lt;input &lt;?php checked( &#039;custom_url&#039;, get_option( &#039;subway_redirect_type&#039; ), true ); ?&gt; value=&quot;custom_url&quot; name=&quot;subway_redirect_type&quot; id=&quot;subway_use_custom_url&quot; type=&quot;radio&quot; class=&quot;code&quot; /&gt; 
            
    &lt;?php esc_html_e( &#039;Custom URL&#039;, &#039;subway&#039; ); ?&gt;

        &lt;/label&gt;

        &lt;!-- Default Behavior --&gt;

        &amp;nbsp;&amp;nbsp;&amp;nbsp;

        &lt;label for=&quot;subway_use_default&quot;&gt;
            
            &lt;input &lt;?php checked( &#039;default&#039;, get_option( &#039;subway_redirect_type&#039; ), true ); ?&gt; value=&quot;default&quot; name=&quot;subway_redirect_type&quot; id=&quot;subway_use_default&quot; type=&quot;radio&quot; class=&quot;code&quot; /&gt; 
            
    &lt;?php esc_html_e( &#039;Default Behavior&#039;, &#039;subway&#039; ); ?&gt;

        &lt;/label&gt;

    &lt;/p&gt;

    &lt;p class=&quot;description&quot;&gt;
    &lt;?php
    esc_html_e(&#039;Where do you want your members to go after logging-in? You can pick a page, a Custom URL, or just a WordPress Default behavior. Page and Custom URL has its settings.&#039;, &#039;subway&#039;
    );
    ?&gt;
    &lt;/p&gt;
    
    &lt;div id=&quot;subway_redirect_page_option_section&quot; class=&quot;hidden subway-redirect-option-section&quot;&gt;
        &lt;label for=&quot;subway_redirect_page_id&quot;&gt;
    &lt;?php esc_html_e( &#039;Select Page&#039; ); ?&gt;
        &lt;/label&gt;

    &lt;?php
    // Choosing page for redirect.
    wp_dropdown_pages(
        array(
                &#039;name&#039; =&gt; &#039;subway_redirect_page_id&#039;,
                &#039;selected&#039; =&gt; intval( get_option( &#039;subway_redirect_page_id&#039; ) ),
                &#039;show_option_none&#039; =&gt; esc_html__( &#039;-&#039;, &#039;subway&#039; ),
        )
    );
    ?&gt;
        &lt;p class=&quot;description&quot;&gt;
    &lt;?php _e( &#039;The selected page will be used as the redirect endpoint for all of your users. Selecting blank (-) will redirect the user to the default redirect defined in WordPress or other plugins. Choose &quot;Custom URL&quot; if you want to redirect to a custom URL or domain.&#039;, &#039;subway&#039; ); ?&gt;
        &lt;/p&gt;
    &lt;/div&gt;

    &lt;div id=&quot;subway_redirect_custom_url_option_section&quot; class=&quot;hidden subway-redirect-option-section&quot;&gt;
        
        &lt;label for=&quot;subway_redirect_custom_url&quot;&gt;
    &lt;?php esc_attr_e( &#039;Enter Redirect URL:&#039;, &#039;subway&#039; ); ?&gt;
        &lt;/label&gt;

        &lt;input value=&quot;&lt;?php echo esc_attr( esc_url( get_option( &#039;subway_redirect_custom_url&#039; ) ) ); ?&gt;&quot; type=&quot;text&quot; name=&quot;subway_redirect_custom_url&quot; placeholder=&quot;&lt;?php esc_attr_e( &#039;http://&#039;, &#039;subway&#039; ); ?&gt;&quot; 
        id=&quot;subway_redirect_custom_url&quot; size=&quot;75&quot; /&gt;

        &lt;p class=&quot;description&quot;&gt;&lt;br&gt;

        &lt;?php
        echo sprintf( __( &#039;When entering a custom domain, you can use a variable string such us: %1$s and %2$s. For example, http://yoursiteurl.com/members/&lt;strong&gt;%2$s&lt;/strong&gt; will translate to http://yoursiteurl/members/&lt;strong&gt;admin&lt;/strong&gt; where &quot;admin&quot; is equal to the %2$s variable; http://yoursiteurl.com/users/&lt;strong&gt;%1$s&lt;/strong&gt; will translate to http://yoursiteurl.com/users/&lt;strong&gt;4&lt;/strong&gt; where &quot;4&quot; is equal to the %1$s. Both variables refer to the current user that is logged-in.&#039;, &#039;subway&#039; ), &#039;%user_id%&#039;, &#039;%user_name%&#039; );
        ?&gt;

        &lt;/p&gt;&lt;br&gt;

        &lt;p class=&quot;description&quot;&gt;
    &lt;?php esc_attr_e( &#039;Leave empty to use existing WordPress or other 3rd party plugin redirect option.&#039;, &#039;subway&#039; ); ?&gt;
        &lt;/p&gt;&lt;br&gt;

        &lt;p class=&quot;description&quot;&gt;
    &lt;?php esc_html_e( &#039;Warning: External URLs are not supported by WordPress Function (wp_safe_redirect) and will be redirected back to default WordPress behavior.&#039;, &#039;subway&#039; ); ?&gt;
        &lt;/p&gt; 

    &lt;/div&gt;

    &lt;!-- Subway Use Default --&gt;
    &lt;div id=&quot;subway_redirect_default_option_section&quot; class=&quot;hidden subway-redirect-option-section&quot;&gt;
        &lt;p&gt;
    &lt;?php
    esc_html_e( &quot;By choosing the default behavior, the redirect type will be set to the default WordPress&#039; behavior. For example, if you have plugins like Peter&#039;s Login Redirect. This option will disable Subway&#039;s redirect and use the Peter&#039;s Login Redirect Instead.&quot;, &#039;subway&#039; );
    ?&gt;
        &lt;/p&gt;
    &lt;/div&gt;


    &lt;script&gt;
        jQuery(document).ready( function( $ ) {

            &quot;use strict&quot;;

            subway_toggle_use_custom_page();    
            subway_toggle_use_custom_url();
            subway_toggle_use_default();

            $(&quot;#subway_use_page&quot;).on(&#039;click&#039;, function(){
                subway_toggle_use_custom_page();    
            });

            $(&quot;#subway_use_custom_url&quot;).on(&#039;click&#039;, function(){
                subway_toggle_use_custom_url();
            });

            $(&quot;#subway_use_default&quot;).on(&#039;click&#039;, function(){
                subway_toggle_use_default();
            });

            function subway_toggle_use_default() {

                if( $(&#039;#subway_use_default&#039;).is(&#039;:checked&#039;)) {

                    $(&#039;#subway_redirect_custom_url_option_section&#039;).addClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_default_option_section&#039;).removeClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_page_option_section&#039;).addClass(&#039;hidden&#039;);
                }

                return;
            }

            function subway_toggle_use_custom_url() {

                if( $(&#039;#subway_use_custom_url&#039;).is(&#039;:checked&#039;)) { 
                    
                    $(&#039;#subway_redirect_custom_url_option_section&#039;).removeClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_default_option_section&#039;).addClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_page_option_section&#039;).addClass(&#039;hidden&#039;);

                }

                return;
            }

            function subway_toggle_use_custom_page() {

                if( $(&#039;#subway_use_page&#039;).is(&#039;:checked&#039;)) { 

                    $(&#039;#subway_redirect_custom_url_option_section&#039;).addClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_default_option_section&#039;).addClass(&#039;hidden&#039;);
                    $(&#039;#subway_redirect_page_option_section&#039;).removeClass(&#039;hidden&#039;);
                }

                return;
            }

        });
    &lt;/script&gt;
    &lt;?php
}</code></pre></div><p>فایڵی README.md</p><br /><br /><div class="codebox"><pre><code data-language=php>[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e85826fc-c1cb-47f1-9448-2a04b7b00eb1/big.png?x_cache=false)](https://insight.sensiolabs.com/projects/e85826fc-c1cb-47f1-9448-2a04b7b00eb1)

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/codehaiku/subway-2.0/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/codehaiku/subway-2.0/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/codehaiku/subway-2.0/badges/build.png?b=master)](https://scrutinizer-ci.com/g/codehaiku/subway-2.0/build-status/master)
&lt;h3&gt;&lt;strong&gt;Subway - Private WordPress Site Option&lt;/strong&gt;&lt;/h3&gt;

Subway is a small plugin for WordPress that allows you to hide the content of your website to non-logged in visitors and only displays them to logged in users.

This plugin redirects the users to the provided login page with a login form that allows them to type their username/email and password combination. 

It validates the users’ credentials and displays a set of configurable messages if there are errors such as invalid username, empty username, wrong password, and etcetera.

The plugin has settings inside the Administration Panel (‘Settings’ &gt; &#039;Subway&#039;) that allows you to configure where you want the user to be taken after he/she has successfully logged in, this can be a page, a custom URL, or just the default behavior.

&lt;strong&gt;Current Version: 2.0.3&lt;/strong&gt;

&lt;h3&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/h3&gt;

Subway is only built for WordPress website owners to redirect non-logged in users to a custom login form. This plugin is not a replacement for Membership websites where a complex set of configurations are allowed. There are no payments model, subscriptions, and role types.

Subway is good for Private Intranet Websites where membership is required.

&lt;h3&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/h3&gt;

&lt;strong&gt;Manual:&lt;/strong&gt;

Download and unzip the &quot;subway.zip&quot; plugin.

Upload the entire &quot;subway&quot; directory to your &#039;/wp-content/plugins/&#039; directory.

Activate the &quot;Subway&quot; plugin through the Plugins menu in WordPress.

Go to ‘Settings’ &gt; ‘Reading’ to set-up the plugin.


&lt;strong&gt;Automatic:&lt;/strong&gt;

Click here to learn how to automatically add the plugin using the built-in plugin installer.</code></pre></div><p>فایڵی&nbsp; &nbsp;subway.php</p><div class="codebox"><pre><code data-language=php>&lt;?php
/**
 * Plugin Name: Subway
 * Description: A WordPress plugin that will help you make your website private. Useful for intranet websites.
 * Version: 1.2.0
 * Author: Dunhakdis
 * Author URI: http://dunhakdis.me
 * Text Domain: subway
 * License: GPL2
 *
 * Includes all the file necessary for Subway.
 *
 * PHP version 5
 *
 * @since     1.0
 * @package subway
 */

if ( ! defined( &#039;ABSPATH&#039; ) ) {
    exit();
}

// Include our plugin login forms and shortcodes.
require_once plugin_dir_path( __FILE__ ) . &#039;login-form.php&#039;;

// Include our plugin functions.
require_once plugin_dir_path( __FILE__ ) . &#039;functions.php&#039;;

// Include the script that handles the redirections.
require_once plugin_dir_path( __FILE__ ) . &#039;private.php&#039;;

// Disable Thrive-Intranet plugin if this plugin is active to prevent conflicts.
register_activation_hook( __FILE__, &#039;subway_deactivate_thrive_intranet&#039; );

// Plugin l10n.
add_action( &#039;plugins_loaded&#039;, &#039;subway_localize_plugin&#039; );

/**
 * Register our activation hook
 * This will actually deactivate the Thrive Intranet plugin.
 *
 * @return void
 */
function subway_deactivate_thrive_intranet() {

    // Deactivate Thrive Intranet in case it is used to prevent conflict.
    require_once( ABSPATH . &#039;wp-admin/includes/plugin.php&#039; );

    // Deactivate the plugin.
    deactivate_plugins( &#039;/thrive-intranet/thrive-intranet.php&#039; );

    return;
}

// Enable GitHub Updater.
add_action( &#039;init&#039;, &#039;subway_plugin_updater_init&#039; );

/**
 * The callback function that wraps &#039;WP_GitHub_Updater&#039;
 * to init action of WordPress to check for our plugin updates.
 *
 * @return void
 */
function subway_plugin_updater_init() {

    if ( is_admin() ) {

        include_once plugin_dir_path( __FILE__ ) . &#039;/update-check.php&#039;;

        $repo_name = &#039;subway&#039;;

        $config = array(
            &#039;slug&#039; =&gt; plugin_basename( __FILE__ ),
            &#039;proper_folder_name&#039; =&gt; &#039;subway&#039;,
            &#039;api_url&#039; =&gt; sprintf( &#039;https://api.github.com/repos/codehaiku/%s&#039;, $repo_name ),
            &#039;raw_url&#039; =&gt; sprintf( &#039;https://raw.github.com/codehaiku/%s/master&#039;, $repo_name ),
            &#039;github_url&#039; =&gt; sprintf( &#039;https://github.com/codehaiku/%s&#039;, $repo_name ),
            &#039;zip_url&#039; =&gt; sprintf( &#039;https://github.com/codehaiku/%s/zipball/master&#039;, $repo_name ),
            &#039;sslverify&#039; =&gt; true,
            &#039;requires&#039; =&gt; &#039;4.0&#039;,
            &#039;tested&#039; =&gt; &#039;4.4.2&#039;,
            &#039;readme&#039; =&gt; &#039;README.md&#039;,
            &#039;access_token&#039; =&gt; &#039;&#039;,
        );

        new WP_GitHub_Updater( $config );

    }

    return;
}

/**
 * Subway l10n callback.
 *
 * @return void
 */
function subway_localize_plugin() {

    $rel_path = basename( dirname( __FILE__ ) ) . &#039;/languages&#039;;

    load_plugin_textdomain( &#039;subway&#039;, false, $rel_path );

    return;
}</code></pre></div><p>فایڵی&nbsp; &nbsp;update-check.php</p><div class="codebox"><pre><code data-language=php>&lt;?php
if ( class_exists( &#039;WP_GitHub_Updater&#039; ) ) {
    return;
}

if ( class_exists( &#039;WPGitHubUpdater&#039; ) ) {
    return;
}

// Prevent loading this file directly and/or if the class is already defined
if ( ! defined( &#039;ABSPATH&#039; ) ) {
    return;
}
/**
 *
 *
 * @version 1.6
 * @author Joachim Kudish &lt;info@jkudish.com&gt;
 * @link http://jkudish.com
 * @package WP_GitHub_Updater
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @copyright Copyright (c) 2011-2013, Joachim Kudish
 *
 * GNU General Public License, Free Software Foundation
 * &lt;http://creativecommons.org/licenses/GPL/2.0/&gt;
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
if ( ! class_exists( &#039;WP_GitHub_Updater&#039; ) ) {
class WP_GitHub_Updater {

    /**
     * GitHub Updater version
     */
    const VERSION = 1.6;

    /**
     * @var $config the config for the updater
     * @access public
     */
    var $config;

    /**
     * @var $missing_config any config that is missing from the initialization of this instance
     * @access public
     */
    var $missing_config;

    /**
     * @var $github_data temporiraly store the data fetched from GitHub, allows us to only load the data once per class instance
     * @access private
     */
    private $github_data;


    /**
     * Class Constructor
     *
     * @since 1.0
     * @param array $config the configuration required for the updater to work
     * @see has_minimum_config()
     * @return void
     */
    public function __construct( $config = array() ) {

        $defaults = array(
            &#039;slug&#039; =&gt; plugin_basename( __FILE__ ),
            &#039;proper_folder_name&#039; =&gt; dirname( plugin_basename( __FILE__ ) ),
            &#039;sslverify&#039; =&gt; true,
            &#039;access_token&#039; =&gt; &#039;&#039;,
        );

        $this-&gt;config = wp_parse_args( $config, $defaults );

        // if the minimum config isn&#039;t set, issue a warning and bail
        if ( ! $this-&gt;has_minimum_config() ) {
            $message = &#039;The GitHub Updater was initialized without the minimum required configuration, please check the config in your plugin. The following params are missing: &#039;;
            $message .= implode( &#039;,&#039;, $this-&gt;missing_config );
            _doing_it_wrong( __CLASS__, $message , self::VERSION );
            return;
        }

        $this-&gt;set_defaults();

        add_filter( &#039;pre_set_site_transient_update_plugins&#039;, array( $this, &#039;api_check&#039; ) );

        // Hook into the plugin details screen
        add_filter( &#039;plugins_api&#039;, array( $this, &#039;get_plugin_info&#039; ), 10, 3 );
        add_filter( &#039;upgrader_post_install&#039;, array( $this, &#039;upgrader_post_install&#039; ), 10, 3 );

        // set timeout
        add_filter( &#039;http_request_timeout&#039;, array( $this, &#039;http_request_timeout&#039; ) );

        // set sslverify for zip download
        add_filter( &#039;http_request_args&#039;, array( $this, &#039;http_request_sslverify&#039; ), 10, 2 );
    }

    public function has_minimum_config() {

        $this-&gt;missing_config = array();

        $required_config_params = array(
            &#039;api_url&#039;,
            &#039;raw_url&#039;,
            &#039;github_url&#039;,
            &#039;zip_url&#039;,
            &#039;requires&#039;,
            &#039;tested&#039;,
            &#039;readme&#039;,
        );

        foreach ( $required_config_params as $required_param ) {
            if ( empty( $this-&gt;config[$required_param] ) )
                $this-&gt;missing_config[] = $required_param;
        }

        return ( empty( $this-&gt;missing_config ) );
    }


    /**
     * Check wether or not the transients need to be overruled and API needs to be called for every single page load
     *
     * @return bool overrule or not
     */
    public function overrule_transients() {
        return ( defined( &#039;WP_GITHUB_FORCE_UPDATE&#039; ) &amp;&amp; WP_GITHUB_FORCE_UPDATE );
    }


    /**
     * Set defaults
     *
     * @since 1.2
     * @return void
     */
    public function set_defaults() {
        if ( !empty( $this-&gt;config[&#039;access_token&#039;] ) ) {

            // See Downloading a zipball (private repo) https://help.github.com/articles/downloading-files-from-the-command-line
            extract( parse_url( $this-&gt;config[&#039;zip_url&#039;] ) ); // $scheme, $host, $path

            $zip_url = $scheme . &#039;://api.github.com/repos&#039; . $path;
            $zip_url = add_query_arg( array( &#039;access_token&#039; =&gt; $this-&gt;config[&#039;access_token&#039;] ), $zip_url );

            $this-&gt;config[&#039;zip_url&#039;] = $zip_url;
        }


        if ( ! isset( $this-&gt;config[&#039;new_version&#039;] ) )
            $this-&gt;config[&#039;new_version&#039;] = $this-&gt;get_new_version();

        if ( ! isset( $this-&gt;config[&#039;last_updated&#039;] ) )
            $this-&gt;config[&#039;last_updated&#039;] = $this-&gt;get_date();

        if ( ! isset( $this-&gt;config[&#039;description&#039;] ) )
            $this-&gt;config[&#039;description&#039;] = $this-&gt;get_description();

        $plugin_data = $this-&gt;get_plugin_data();
        if ( ! isset( $this-&gt;config[&#039;plugin_name&#039;] ) )
            $this-&gt;config[&#039;plugin_name&#039;] = $plugin_data[&#039;Name&#039;];

        if ( ! isset( $this-&gt;config[&#039;version&#039;] ) )
            $this-&gt;config[&#039;version&#039;] = $plugin_data[&#039;Version&#039;];

        if ( ! isset( $this-&gt;config[&#039;author&#039;] ) )
            $this-&gt;config[&#039;author&#039;] = $plugin_data[&#039;Author&#039;];

        if ( ! isset( $this-&gt;config[&#039;homepage&#039;] ) )
            $this-&gt;config[&#039;homepage&#039;] = $plugin_data[&#039;PluginURI&#039;];

        if ( ! isset( $this-&gt;config[&#039;readme&#039;] ) )
            $this-&gt;config[&#039;readme&#039;] = &#039;README.md&#039;;

    }


    /**
     * Callback fn for the http_request_timeout filter
     *
     * @since 1.0
     * @return int timeout value
     */
    public function http_request_timeout() {
        return 2;
    }

    /**
     * Callback fn for the http_request_args filter
     *
     * @param unknown $args
     * @param unknown $url
     *
     * @return mixed
     */
    public function http_request_sslverify( $args, $url ) {
        if ( $this-&gt;config[ &#039;zip_url&#039; ] == $url )
            $args[ &#039;sslverify&#039; ] = $this-&gt;config[ &#039;sslverify&#039; ];

        return $args;
    }


    /**
     * Get New Version from GitHub
     *
     * @since 1.0
     * @return int $version the version number
     */
    public function get_new_version() {
        $version = get_site_transient( md5($this-&gt;config[&#039;slug&#039;]).&#039;_new_version&#039; );

        if ( $this-&gt;overrule_transients() || ( !isset( $version ) || !$version || &#039;&#039; == $version ) ) {

            $raw_response = $this-&gt;remote_get( trailingslashit( $this-&gt;config[&#039;raw_url&#039;] ) . basename( $this-&gt;config[&#039;slug&#039;] ) );

            if ( is_wp_error( $raw_response ) )
                $version = false;

            if (is_array($raw_response)) {
                if (!empty($raw_response[&#039;body&#039;]))
                    preg_match( &#039;/.*Version\:\s*(.*)$/mi&#039;, $raw_response[&#039;body&#039;], $matches );
            }

            if ( empty( $matches[1] ) )
                $version = false;
            else
                $version = $matches[1];

            // back compat for older readme version handling
            // only done when there is no version found in file name
            if ( false === $version ) {
                $raw_response = $this-&gt;remote_get( trailingslashit( $this-&gt;config[&#039;raw_url&#039;] ) . $this-&gt;config[&#039;readme&#039;] );

                if ( is_wp_error( $raw_response ) )
                    return $version;

                preg_match( &#039;#^\s*`*~Current Version\:\s*([^~]*)~#im&#039;, $raw_response[&#039;body&#039;], $__version );

                if ( isset( $__version[1] ) ) {
                    $version_readme = $__version[1];
                    if ( -1 == version_compare( $version, $version_readme ) )
                        $version = $version_readme;
                }
            }

            // refresh every 6 hours
            if ( false !== $version )
                set_site_transient( md5($this-&gt;config[&#039;slug&#039;]).&#039;_new_version&#039;, $version, 60*60*6 );
        }

        return $version;
    }


    /**
     * Interact with GitHub
     *
     * @param string $query
     *
     * @since 1.6
     * @return mixed
     */
    public function remote_get( $query ) {
        if ( ! empty( $this-&gt;config[&#039;access_token&#039;] ) )
            $query = add_query_arg( array( &#039;access_token&#039; =&gt; $this-&gt;config[&#039;access_token&#039;] ), $query );

        $raw_response = wp_remote_get( $query, array(
            &#039;sslverify&#039; =&gt; $this-&gt;config[&#039;sslverify&#039;]
        ) );

        return $raw_response;
    }


    /**
     * Get GitHub Data from the specified repository
     *
     * @since 1.0
     * @return array $github_data the data
     */
    public function get_github_data() {
        if ( isset( $this-&gt;github_data ) &amp;&amp; ! empty( $this-&gt;github_data ) ) {
            $github_data = $this-&gt;github_data;
        } else {
            $github_data = get_site_transient( md5($this-&gt;config[&#039;slug&#039;]).&#039;_github_data&#039; );

            if ( $this-&gt;overrule_transients() || ( ! isset( $github_data ) || ! $github_data || &#039;&#039; == $github_data ) ) {
                $github_data = $this-&gt;remote_get( $this-&gt;config[&#039;api_url&#039;] );

                if ( is_wp_error( $github_data ) )
                    return false;

                $github_data = json_decode( $github_data[&#039;body&#039;] );

                // refresh every 6 hours
                set_site_transient( md5($this-&gt;config[&#039;slug&#039;]).&#039;_github_data&#039;, $github_data, 60*60*6 );
            }

            // Store the data in this class instance for future calls
            $this-&gt;github_data = $github_data;
        }

        return $github_data;
    }


    /**
     * Get update date
     *
     * @since 1.0
     * @return string $date the date
     */
    public function get_date() {
        $_date = $this-&gt;get_github_data();
        return ( !empty( $_date-&gt;updated_at ) ) ? date( &#039;Y-m-d&#039;, strtotime( $_date-&gt;updated_at ) ) : false;
    }


    /**
     * Get plugin description
     *
     * @since 1.0
     * @return string $description the description
     */
    public function get_description() {
        $_description = $this-&gt;get_github_data();
        return ( !empty( $_description-&gt;description ) ) ? $_description-&gt;description : false;
    }


    /**
     * Get Plugin data
     *
     * @since 1.0
     * @return object $data the data
     */
    public function get_plugin_data() {
        include_once ABSPATH.&#039;/wp-admin/includes/plugin.php&#039;;
        $data = get_plugin_data( WP_PLUGIN_DIR.&#039;/&#039;.$this-&gt;config[&#039;slug&#039;] );
        return $data;
    }


    /**
     * Hook into the plugin update check and connect to GitHub
     *
     * @since 1.0
     * @param object  $transient the plugin data transient
     * @return object $transient updated plugin data transient
     */
    public function api_check( $transient ) {

        // Check if the transient contains the &#039;checked&#039; information
        // If not, just return its value without hacking it
        if ( empty( $transient-&gt;checked ) )
            return $transient;

        // check the version and decide if it&#039;s new
        $update = version_compare( $this-&gt;config[&#039;new_version&#039;], $this-&gt;config[&#039;version&#039;] );

        if ( 1 === $update ) {
            $response = new stdClass;
            $response-&gt;new_version = $this-&gt;config[&#039;new_version&#039;];
            $response-&gt;slug = $this-&gt;config[&#039;proper_folder_name&#039;];
            $response-&gt;url = add_query_arg( array( &#039;access_token&#039; =&gt; $this-&gt;config[&#039;access_token&#039;] ), $this-&gt;config[&#039;github_url&#039;] );
            $response-&gt;package = $this-&gt;config[&#039;zip_url&#039;];

            // If response is false, don&#039;t alter the transient
            if ( false !== $response )
                $transient-&gt;response[ $this-&gt;config[&#039;slug&#039;] ] = $response;
        }

        return $transient;
    }


    /**
     * Get Plugin info
     *
     * @since 1.0
     * @param bool    $false  always false
     * @param string  $action the API function being performed
     * @param object  $args   plugin arguments
     * @return object $response the plugin info
     */
    public function get_plugin_info( $false, $action, $response ) {

        // Check if this call API is for the right plugin
        if ( !isset( $response-&gt;slug ) || $response-&gt;slug != $this-&gt;config[&#039;slug&#039;] )
            return false;

        $response-&gt;slug = $this-&gt;config[&#039;slug&#039;];
        $response-&gt;plugin_name  = $this-&gt;config[&#039;plugin_name&#039;];
        $response-&gt;version = $this-&gt;config[&#039;new_version&#039;];
        $response-&gt;author = $this-&gt;config[&#039;author&#039;];
        $response-&gt;homepage = $this-&gt;config[&#039;homepage&#039;];
        $response-&gt;requires = $this-&gt;config[&#039;requires&#039;];
        $response-&gt;tested = $this-&gt;config[&#039;tested&#039;];
        $response-&gt;downloaded   = 0;
        $response-&gt;last_updated = $this-&gt;config[&#039;last_updated&#039;];
        $response-&gt;sections = array( &#039;description&#039; =&gt; $this-&gt;config[&#039;description&#039;] );
        $response-&gt;download_link = $this-&gt;config[&#039;zip_url&#039;];

        return $response;
    }


    /**
     * Upgrader/Updater
     * Move &amp; activate the plugin, echo the update message
     *
     * @since 1.0
     * @param boolean $true       always true
     * @param mixed   $hook_extra not used
     * @param array   $result     the result of the move
     * @return array $result the result of the move
     */
    public function upgrader_post_install( $true, $hook_extra, $result ) {

        global $wp_filesystem;

        // Move &amp; Activate
        $proper_destination = WP_PLUGIN_DIR.&#039;/&#039;.$this-&gt;config[&#039;proper_folder_name&#039;];
        $wp_filesystem-&gt;move( $result[&#039;destination&#039;], $proper_destination );
        $result[&#039;destination&#039;] = $proper_destination;
        $activate = activate_plugin( WP_PLUGIN_DIR.&#039;/&#039;.$this-&gt;config[&#039;slug&#039;] );

        // Output the update message
        $fail  = __( &#039;The plugin has been updated, but could not be reactivated. Please reactivate it manually.&#039;, &#039;github_plugin_updater&#039; );
        $success = __( &#039;Plugin reactivated successfully.&#039;, &#039;github_plugin_updater&#039; );
        echo is_wp_error( $activate ) ? $fail : $success;
        return $result;

    }
}
}</code></pre></div><br /><br /><br /><br /><br /><p><h2><span style="color: #de2c10">هاوکاریتان توانای هاوکاریم بەرز دەکاتەوە</span></h2></p>]]></content>
			<author>
				<name><![CDATA[xaly]]></name>
				<uri>https://www.webchin.org/Meko/profile.php?id=48498</uri>
			</author>
			<updated>2017-03-11T13:49:37Z</updated>
			<id>https://www.webchin.org/Meko/viewtopic.php?pid=264260#p264260</id>
		</entry>
</feed>
