Plugin Directory

Changeset 2850884


Ignore:
Timestamp:
01/19/2023 07:23:04 AM (3 years ago)
Author:
outgrow
Message:

updating plugin to match wordpress version

Location:
outgrow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • outgrow/trunk/outgrow-api.php

    r2644079 r2850884  
    167167if (isset($_POST['header_script1'])) {
    168168    if($_POST['header_script1']!=""){
     169         $hello="hello";
    169170        $out=check_Repeat($_POST['header_script1']);
    170171        if($out!="present"){
    171172        global $wpdb;
     173     
    172174        $apiKey     = sanitize_text_field($_POST['header_script1']);
    173175        $table_name = 'wp_outgrow_calci_table';
     
    182184        $meta        = array();
    183185        if($res->data){
    184             $calci_count = count($res->data);
     186            $calci_count = count_($res->data);
    185187        }     
    186188        if ($res->success == "true" || $res->code != 401 && $calci_count>0) {
     
    237239            );
    238240            // live api
    239             $request    = Requests::get('https://api-calc.outgrow.co/api/v1/calculator?status=Live&type=All&sort=alpha_as', $headers);
     241            $request = Requests::get('https://api-calc.outgrow.co/api/v1/calculator?status=Live&type=All&sort=alpha_as', $headers);
    240242            $res        = json_decode($request->body);
    241243            if ($res->code == 401 ) {
     
    268270    <form name="form1" method="post" style="margin-bottom:0em;" >
    269271        <div class="main-text-area" >
    270             <input type="text" name="header_script1"  class="select-box" id="header_script" Placeholder="Enter/Select API KEY" autocomplete="off">
     272            <input type="text" name="header_script1[]"  class="select-box" id="header_script" Placeholder="Enter/Select API KEY" autocomplete="off">
    271273                <span class="select-img" onclick="showOption()">
    272274                    <img src="<?php echo plugins_url('/images/select.png', __FILE__) ?>"  alt="arrow">
     
    277279    <div id="main-section-option" style="display: none;">
    278280    <form name="form1" style="margin-bottom:0em;" method="post">
    279         <ul class="main-list">           
    280 <?php
    281                 global $wpdb;
    282                 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table');
     281        <ul class="main-list">         
     282       
     283<?php 
     284              global $wpdb;
     285                $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table');?>
     286               
     287           
     288                        <?php
    283289                if($db_result){
    284290                    foreach ($db_result as $db_row) {
    285291?>
    286292                        <li id="api-list">
    287                        <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>">
     293                       <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>"> <?php echo ($_POST['header_script1']);?>
    288294                        <button name="delete_data" class="list-close" value="<?php echo $db_row->api_key ?>">x</button>
    289295                        </li>
     
    291297                    }
    292298                }
     299                else{
     300                      foreach ($_POST['header_script1'] as $demoel)
     301                      {
     302                    ?>
     303                     <li id="api-list">
     304                      <input type="button" class="option" id="select-api-key"
     305                      onclick="selectKey('<?php echo $demoel; ?>')" name ="show_data" value="<?php echo $demoel; echo $hello;?>">
     306                        <button name="delete_data" class="list-close" value="<?php echo $demoel; ?>">x</button>
     307                        </li>
     308                        <?php
     309                }
     310            }
    293311?>
    294312        </ul>
     
    388406            'api_key' => $item
    389407        ));
    390         if(count($apiArray)==1){
     408        if(count_($apiArray)==1){
    391409            setcookie('API', null, -1, '/');
    392410        }
     
    530548
    531549// add_action('wp_before_admin_bar_render', 'wpb_custom_logo');
    532 
     550function count_($array) {
     551    echo $array; ?>
     552    <?php console_log($array); ?> <?
     553    return is_array($array) ? count_($array) : 0;
     554}
    533555
    534556// for api key
     
    536558    global $wpdb;
    537559    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    538     if (count($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_api_table"') < 0)) {
     560    if (count_($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_api_table"') < 0)) {
    539561        $sql_query_to_create_table = "CREATE TABLE `wp_outgrow_calci_api_table` (
    540562            `api_key` varchar(160) NOT NULL ,
     
    548570    global $wpdb;
    549571    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    550     if (count($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_table"') < 0)) {
     572    if (count_($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_table"') < 0)) {
    551573        $sql_query_to_create_table = "CREATE TABLE `wp_outgrow_calci_table` (
    552574            `name` varchar(50) NOT NULL,
  • outgrow/trunk/readme.txt

    r2634568 r2850884  
    44Tags: outgrow, quizzes, calculators, polls, interactive calculators, trending calculators, trending quizzes,outgrow calci, outgrow calculator, outgrow quiz, outgrow quizzes, calculator, quiz
    55Requires at least:5.2
    6 Tested up to: 5.8.2
    7 Stable tag: 2.0
     6Tested up to: 6.0.2
     7Stable tag: 2.1
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.