Plugin Directory

Changeset 2419182


Ignore:
Timestamp:
11/16/2020 07:04:33 AM (5 years ago)
Author:
intygrate
Message:

Fixed issue with CSS overriding wordpress defaults, small code tidy up

Location:
censorreact/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • censorreact/trunk/assets/css/styles.css

    r2247872 r2419182  
    1414}
    1515
    16 h1{
    17     color: rgb(32,116,57);
    18     font-weight: 400;
    19 }
    20 
    21 h2{
    22     text-align: center;
    23     color: rgb(32,116,57);
    24     font-weight: 400;
    25 }
    26 
    27 h3{
    28     text-align: center;
    29     color: rgb(32,116,57);
    30     font-weight: 400;
    31 }
    32 
    33 label{
     16label.censorreact-label{
    3417    display: block;
    3518    text-align: left;
     
    4023}
    4124
    42 input{
     25input.censorreact-input{
    4326    width: 100%;
    4427}
     
    428411}
    429412
    430 div#censorreact-form-errors-div{
    431     /* height: 30px; */
    432     position: relative;
    433 }
    434413div#censorreact-show-errors{
    435414    color: red;
    436415    text-align: left;
    437     position: absolute;
    438     top: -25px;
    439416}
    440417
     
    442419    color: black;
    443420}
     421
     422div#censorreact-intygrate-website a {
     423    color: white;
     424}
  • censorreact/trunk/censorreact.php

    r2247884 r2419182  
    1212Plugin URI: https://intygrate.com/censorreact
    1313Description: censorREACT protects your site, from inappropriate content, when filtering/verifying text and moderating images. censorREACT offers both pre-defined and customised settings to ensure protection for your business.
    14 Version: 1.0.1
     14Version: 1.0.2
    1515Author: Intygrate
    1616Author URI: https://intygrate.com
  • censorreact/trunk/readme.txt

    r2249578 r2419182  
    44Requires at least: 4.0
    55Tested up to: 5.3.2
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
     
    202202* Split the login and signup forms into individual forms.
    203203* Added a resend code button in the confirmation code form.
    204 * Bug fixes
     204* Bug fixes.
     205
     206= 1.0.2 =
     207
     208* removed conflicting CSS.
  • censorreact/trunk/templates/admin-page.php

    r2247872 r2419182  
    11<!-- Place the title of the page -->
    22<div class='censorreact-plugin-page'>
    3     <!-- <div class='censorreact-plugin-page-inner'> -->
    4 
    53    <div class='censorreact-plugin-logo-div'>
    64        <img class='censorreact-plugin-logo'  src= '<?= CENSORREACT_PLUGIN_URL ?>assets/images/censorREACT-logo.png' alt='censorREACT logo'>
    75    </div>
    8 
    9 
    106    <hr class="wp-header-end">
    11 
    12 
    137<?php
    14 //This global variable connects to the wordpress database
    158global $wpdb;
    16 //Creating the table name for the returned key
    179$plugin_table_name = "censorreact_plugin";
    18 
    19 //Get the key from the database
    2010$get_key_from_database = $wpdb->get_results("SELECT `key` FROM `$plugin_table_name`");
    2111
     
    8373
    8474    censorreact_register_user($email, $password, $confirmPassword, $confirmationCode, $terms);
    85 
    8675}
    8776
    8877//Check if the form 'get-key-user' is set
    8978if(isset($_POST['censorreact-get-key-user'])) {
    90 
    9179    //This global variable connects to the wordpress database
    9280    global $wpdb;
     
    195183        return;
    196184    }
    197 
    198185   
    199186    //if the code isnt success then it will display the error from the API
     
    260247   
    261248    if(array_key_exists('code', $apiResponse)) {
    262 
    263249        if($apiResponse['code'] === 200) {
    264        
    265250            //Make sure the key is set before moving on, if not then show an error
    266251            if(isset($apiBody->data->key)) {
    267 
    268252                //Set the key from the api response to the variable
    269253                $censorReactKey = $apiBody->data->key;
    270 
    271254                //Set the key from the API into the database
    272255                $wpdb->query("UPDATE `{$plugin_table_name}`
     
    274257                                WHERE `id` = 1"
    275258                );
    276 
    277259                return;
    278260            }
    279 
    280261            //If for some reason the code is a success and the key is still not in there then it will display this error code
    281262            print('<div class="notice-error notice"><p>Your key could not be found. Please try again.</p></div>');
     
    301282    //Make sure they enter a password
    302283    if(!empty($password) && !empty($confirmPassword)) {
    303 
    304284        //If the passwords are the same
    305285        if($password === $confirmPassword) {
    306 
    307286            //Get the arguments ready to send through to the API
    308287            $args = array(
     
    323302            //Connect to the API
    324303            $apiReturn = wp_remote_request( 'https://api.censorreact.intygrate.com/v1/register', $args );
    325 
    326304            $encodedBody = json_decode($apiReturn['body'], true);
    327305            $apiBody = json_decode($apiReturn['body']);
    328306
    329             error_log(print_r($apiReturn, true));
    330 
    331307            if($encodedBody['data'] === 'confirm_required') {
    332                 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'
    333                 ");
     308                $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'");
    334309
    335310                //Set the key from the API into the database
     
    341316                return;
    342317            } else if(isset($apiBody->data->key)) {
    343                 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'
    344                 ");
     318                $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'");
    345319
    346320                //Set the key from the API into the database
     
    358332           
    359333            if(array_key_exists('code', $apiResponse)) {
    360 
    361334                if($apiResponse['code'] === 200) {
    362                
    363335                    //Make sure the key is set before moving on, if not then show an error
    364336                    if(isset($apiBody->data->key)) {
    365 
    366337                        //Set the key from the api response to the variable
    367338                        $censorReactKey = $apiBody->data->key;
    368 
    369339                        //Set the key from the API into the database
    370340                        $wpdb->query("UPDATE `{$plugin_table_name}`
    371                                         SET `key` = '{$censorReactKey}', `user_confirmed` = 'yes', `key_is_valid` = 'yes'
    372                                         WHERE `id` = 1"
     341                            SET `key` = '{$censorReactKey}', `user_confirmed` = 'yes', `key_is_valid` = 'yes'
     342                            WHERE `id` = 1"
    373343                        );
    374344
     
    425395
    426396    if($encodedBody['data'] === 'confirm_required') {
    427         $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'
    428         ");
     397        $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'");
    429398
    430399        //Set the key from the API into the database
     
    469438if(isset($get_key_from_database[0]->key) && $user_confirmed[0]->user_confirmed == 'yes') {
    470439?> 
    471 
    472440    <div id="censorreact-activated-page" class="censorreact-container">
    473 
    474441        <div id="censorreact-activated-page-inner">
    475 
    476442            <div id="censorreact-user-key">
    477443                <h2>Details</h2>
    478 
    479444                <div id="censorreact-user-key-inner">
    480 
    481445                    <div id="censorreact-status">
    482446                        <p>Account Status:</p>
    483 
    484447                        <?php
    485448                            if ($get_key_valid[0]->key_is_valid === 'yes' && $limit_reached[0]->limit_reached !== 'yes' ) {
     
    493456                            }
    494457                        ?>
    495 
    496458                    </div>
    497459                    <div id="censorreact-username">
     
    502464                        <p>Key:</p>
    503465                        <p><?= $get_key_from_database[0]->key ?></p>
    504                 </div>
     466                    </div>
    505467                </div>
    506468            </div>
    507 
    508469            <div id="censorreact-get-latest">
    509470                <div id="censorreact-get-latest-inner">
    510471                    <h2>Get latest key</h2>
    511 
    512472                    <p>Enter your censorREACT login details.</p>
    513 
    514473                    <div id='censorreact-settings-page-content'>
    515                         <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK!  -->
    516474                        <div id="censorreact-form-errors-div">
    517475                            <div id='censorreact-show-errors' class=''></div>
     
    520478                            <form name='censorreact-get-key-form' id='censorreact-get-key-form' method='post'>
    521479                                <div class='censorreact-input-group'>
    522                                     <label>Email</label>
    523                                     <input type='email' name='censorreact-get-key-email' id='censorreact-get-key-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>
     480                                    <label class="censorreact-label">Email</label>
     481                                    <input class='censorreact-input' type='email' name='censorreact-get-key-email' id='censorreact-get-key-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>
    524482                                </div>
    525483                                <div class='censorreact-input-group'>
    526                                     <label>Password</label>
    527                                     <input type='password' name='censorreact-get-key-password' id='censorreact-get-key-password' placeholder='Enter Password'>
     484                                    <label class="censorreact-label">Password</label>
     485                                    <input class="censorreact-input" type='password' name='censorreact-get-key-password' id='censorreact-get-key-password' placeholder='Enter Password'>
    528486                                </div>
    529487                                <div class='censorreact-button-div'>
     
    547505    <div id='censorreact-confirm'>
    548506        <div id='censorreact-confirm-inner'>
    549        
    550507            <div id='censorreact-plugin-subtitle'>
    551508                <h2 id='login-text'>Confirmation</h2>
    552509                <p id='verify-text'>A verification code has been sent to your email. Please enter your code below.</p>
    553510            </div>
    554 
    555511            <div id='censorreact-confirm-page-content'>
    556512                <div id='censorreact-confirm-form'>         
    557                     <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK!  -->
    558513                    <div id="censorreact-form-errors-div">
    559514                        <div id='censorreact-show-errors' class=''></div>
     
    561516                    <form name='censorreact-confirm-form' id='censorreact-confirm-form' method='post'>
    562517                        <div class='censorreact-input-group'>
    563                             <label>Email</label>
    564                             <input type='email' name='censorreact-confirm-email' id='censorreact-confirm-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>
     518                            <label class="censorreact-label">Email</label>
     519                            <input class="censorreact-input" type='email' name='censorreact-confirm-email' id='censorreact-confirm-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>
    565520                        </div>
    566521                        <div class='censorreact-confirmation-code-input'>
    567                             <label>Confirmation Code</label>
    568                             <input type='text' name='censorreact-confirmation-code' id='censorreact-confirmation-code'
     522                            <label class="censorreact-label">Confirmation Code</label>
     523                            <input class="censorreact-input" type='text' name='censorreact-confirmation-code' id='censorreact-confirmation-code'
    569524                            maxlength='6'
    570525                            placeholder='Confirmation Code'>
     
    586541<?php
    587542} else {
    588 
    589    
    590 
    591543    if(isset($_POST['censorreact-login-signup'])){
    592544        error_log('is set loginsignup');
     
    608560    }
    609561?>
    610 
    611 
    612562    <div id='censorreact-login-signup-div'>
    613563        <form name='censorreact-login-signup' id='censorreact-login-signup' method='post'>
     
    616566        </form>
    617567    </div>
    618 
    619568    <div id="censorreact-login-signup-page">
    620 
    621569        <?php if($_SESSION['signup-login'] === 'login') { ?>
    622        
    623570            <div id='censorreact-login'>
    624571                <div id='censorreact-login-inner'>
    625                
    626                     <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK!  -->
    627572                    <div id="censorreact-form-errors-div">
    628573                        <div id='censorreact-show-errors' class=''></div>
     
    631576                        <form name='censorreact-login-form' id='censorreact-login-form' method='post' novalidate>
    632577                            <div class='censorreact-input-group'>
    633                                 <label>Email</label>
    634                                 <input type='email' name='censorreact-login-email' id='censorreact-login-email' placeholder='Enter Email'>
     578                                <label class="censorreact-label">Email</label>
     579                                <input class="censorreact-input" type='email' name='censorreact-login-email' id='censorreact-login-email' placeholder='Enter Email'>
    635580                            </div>
    636581                            <div class='censorreact-input-group'>
    637                                 <label>Password</label>
    638                                 <input type='password' name='censorreact-login-password' id='censorreact-login-password' placeholder='Enter Password'>
     582                                <label class="censorreact-label">Password</label>
     583                                <input class="censorreact-input" type='password' name='censorreact-login-password' id='censorreact-login-password' placeholder='Enter Password'>
    639584                            </div>
    640585                            <div class='censorreact-button-div'>
     
    648593            <div id='censorreact-signup'>
    649594                <div id='censorreact-signup-inner'>
    650 
    651                     <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK!  -->
    652595                    <div id="censorreact-form-errors-div">
    653596                        <div id='censorreact-show-errors' class=''></div>
     
    656599                        <form name='censorreact-register-form' id='censorreact-register-form' method='post' novalidate>
    657600                            <div class='censorreact-input-group'>
    658                                 <label>Email</label>
    659                                 <input type='email' name='censorreact-register-email' id='censorreact-register-email' placeholder='Enter Email'>
     601                                <label class="censorreact-label">Email</label>
     602                                <input class="censorreact-input" type='email' name='censorreact-register-email' id='censorreact-register-email' placeholder='Enter Email'>
    660603                            </div>
    661604                            <div class='censorreact-input-group'>
    662                                 <label>Password</label>
    663                                 <input type='password' name='censorreact-register-password' id='censorreact-register-password' placeholder='Enter Password'>
     605                                <label class="censorreact-label">Password</label>
     606                                <input class="censorreact-input" type='password' name='censorreact-register-password' id='censorreact-register-password' placeholder='Enter Password'>
    664607                            </div>
    665608                            <div class='censorreact-input-group'>
    666                                 <label>Confirm password</label>
    667                                 <input type='password' name='censorreact-register-password-confirm' id='censorreact-register-password-confirm' placeholder='Confirm Password'>
     609                                <label class="censorreact-label">Confirm password</label>
     610                                <input class="censorreact-input" type='password' name='censorreact-register-password-confirm' id='censorreact-register-password-confirm' placeholder='Confirm Password'>
    668611                            </div>
    669612                            <div id="censorreact-terms-div" class='censorreact-input-group'>
    670613                                <input type="checkbox" name="censorreact-terms" id='censorreact-terms'>
    671                                 <label id='censorreact-terms'>I agree to the <a href='https://intygrate.com/terms-of-service' target='_blank'>Intygrate Terms of Service</a></label>
     614                                <label class="censorreact-label" id='censorreact-terms'>I agree to the <a href='https://intygrate.com/terms-of-service' target='_blank'>Intygrate Terms of Service</a></label>
    672615                            </div>
    673616                            <div class='censorreact-button-div'>
     
    678621                </div>
    679622            </div>
    680 
    681            
    682623        <?php } ?>
    683624    </div>
    684 
    685        
    686625<?php
    687626}
    688627?>
    689 
    690     <!-- </div> -->
    691628</div>
Note: See TracChangeset for help on using the changeset viewer.