Plugin Directory

Changeset 2500100


Ignore:
Timestamp:
03/20/2021 02:16:17 PM (5 years ago)
Author:
stappdevelopment
Message:
  • Enable Support for Pro Version
Location:
stapp-video
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • stapp-video/tags/1.0/readme.txt

    r2495988 r2500100  
    3333== Questions & Support ==
    3434
    35 For more informations, please visit us at: [dev-wordpress.com](https://dev-wordpress.com/)
    36 If you have any questions, please contact us Mail(mailto:[email protected] "[email protected]")
     35For more informations, please visit us at: [dev-wordpress.com](https://dev-wordpress.com/produkt/video/)
     36If you have any questions, please [contact us directly](https://dev-wordpress.com/contact/)
     37
    3738
    3839== Changelog ==
    3940
     41
    4042= 1.0 =
    4143
     44 * Initial release
    4245
    4346
    44 
  • stapp-video/trunk/admin/admin.php

    r2495895 r2500100  
    22
    33include_once STAPP_VIDEO_PLUGIN_DIR.'/includes/db/stapp_video_writeData.php';
     4
     5/*
     6 * Message / Result
     7 */
     8
     9$Stapp_Video_Result_Type = [
     10    'message' => '',
     11    'value' => '',
     12    'success' => false
     13    ];
     14
    415
    516add_action( 'admin_init', 'stapp_video_admin_init', 10, 0 );
     
    2536        'stappvideo',
    2637        'stapp_video_page_mainmenu_html',
    27         'dashicons-menu-alt3',
     38        'dashicons-playlist-video',
    2839        $_wp_last_object_menu
    2940    );
     
    5263    add_action( 'load-' . $addnew, 'stapp_video_create_admin', 10, 0 );
    5364
    54     //}
     65
     66    if (!checkSTAppVideoIsProEnabled()) {
     67        $stapp_pro_page = add_submenu_page(
     68            'stappvideo',
     69            __('STApp Video Pro Version', 'stapp_video'),
     70            __('Pro Version', 'stapp_video'),
     71            'manage_options',
     72            'stappvideo_pro_version',
     73            'stapp_video_page_proversion_html'
     74        );
     75
     76        add_action('load-' . $stapp_pro_page, 'stapp_video_proversion_admin', 10, 0);
     77    }
    5578}
    5679
     
    6184function stapp_video_page_create_html(){
    6285    require_once STAPP_VIDEO_PLUGIN_DIR."/admin/menu/CreateSubMenuHTML.php";
     86}
     87
     88function stapp_video_page_proversion_html(){
     89    require_once STAPP_VIDEO_PLUGIN_DIR."/admin/menu/ProVersionSubMenuHTML.php";
    6390}
    6491
     
    76103
    77104function stapp_video_create_admin(){
    78     if ( isset($_POST['action']) ){
     105    if ( isset($_POST['save_action']) ){
    79106        $data = sanitize_post($_POST);
    80107        $cdatabase = new stapp_video_writeData;
     
    83110}
    84111
     112
     113function stapp_video_proversion_admin(){
     114    $GLOBALS['Stapp_Video_Result_Type']['message'] = '';
     115    $GLOBALS['Stapp_Video_Result_Type']['success'] = false;
     116    if ( isset($_POST['unlock_action']) ){
     117        $data = sanitize_post($_POST);
     118        $cClass = new stapp_video_unlock_plugin();
     119        $cClass->unlock($data);
     120    }
     121
     122}
     123
  • stapp-video/trunk/admin/menu/OverviewSubMenuHTML.php

    r2495895 r2500100  
    3434<div class="wrap">
    3535    <h1><?php esc_html_e( get_admin_page_title() ); ?></h1>
     36    <?php
     37    // output security fields for the registered setting "wporg_options"
     38    settings_fields( 'manage_options' );
     39    // output setting sections and their fields
     40    // (sections are registered for "wporg", each field is registered to a specific section)
     41    do_settings_sections( 'manage_options' );
     42    ?>
    3643    <br>
    3744    <div class="stapp_input white_background"><label class="mainLabel"><?php esc_html_e( "Getting started", 'stapp_video' ); ?></label>
  • stapp-video/trunk/includes/css/styleForCreate.css

    r2495895 r2500100  
    1 /*
    2     Global Classes for all Tabs
    3  */
    4 
    5 
    6 .mainLabel{
    7     top: -10px;
    8     left: 10px;
    9     background-color: #f1f1f1;
    10     position: relative;
    11 }
    12 
    13 .important_label{
    14     color: red;
    15 }
    16 
    17 .slider{
    18     -webkit-appearance: none;
    19     width: 100%;
    20     height: 25px;
    21     background: #d3d3d3;
    22     outline: none;
    23     opacity: 0.7;
    24     -webkit-transition: .2s;
    25     transition: opacity .2s;
    26     border-style: solid;
    27     border-color: black;
    28     border-width: 2px;
    29     border-radius: 5px;
    30 }
    31 
    32 .slider::-webkit-slider-thumb {
    33     -webkit-appearance: none;
    34     appearance: none;
    35     top: -5px;
    36     width: 15px;
    37     height: 35px;
    38     background: none;
    39     border-style: solid;
    40     border-color: black;
    41     border-width: 2px;
    42     border-radius: 5px;
    43     cursor: pointer;
    44 }
    45 
    46 .slider::-moz-range-thumb {
    47     top: -5px;
    48     width: 15px;
    49     height: 35px;
    50     background: none;
    51     border-style: solid;
    52     border-color: black;
    53     border-width: 2px;
    54     border-radius: 5px;
    55     cursor: pointer;
    56 }
    57 
    58 
    59 
    60 
    61 .color_slider_bg {
    62     background: -webkit-gradient(linear, left top, right top, from(red), color-stop(17%, #ff0), color-stop(33%, lime), color-stop(50%, cyan), color-stop(66%, blue), color-stop(83%, #f0f), to(red));
    63     background:linear-gradient(to right, red, #ff0 17%, lime 33%, cyan, blue 66%, #f0f 83%, red);
    64 }
    65 
    66 .LinkButton{
    67     text-align: center;
    68     vertical-align: middle;
    69     line-height: 60px;
    70     background: #0073aa;
    71     color: white;
    72     height: 60px;
    73     font-size: 17px;
    74     cursor: pointer;
    75 }
    76 
    77 
    78 .hidden{
    79     display: none;
    80 }
    81 
    82 .text_input{
    83     width: 100%;
    84 }
    85 
    86 
    87 
    88 
    891/*
    902    Elements on Color Tab
     
    16375}
    16476
    165 
    166 .divButton{
    167     text-align: center;
    168     vertical-align: middle;
    169     background: #777777;
    170     color: white;
    171     font-size: 17px;
    172     cursor: pointer;
    173     width: 20%;
    174     padding: 3px 10px 3px 10px;
    175     top: 10px;
    176     position: relative;
    177     box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.28);
    178 }
    179 .divButton:hover{
    180     color: white;
    181     background: #777777;
    182     box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    183 }
  • stapp-video/trunk/includes/css/styleForGlobalBackend.css

    r2495895 r2500100  
    120120}
    121121
     122/*
     123DIV BUTTTON
     124 */
     125
     126
     127
     128.divButton{
     129    text-align: center;
     130    vertical-align: middle;
     131    background: #777777;
     132    color: white;
     133    font-size: 17px;
     134    cursor: pointer;
     135    width: 20%;
     136    padding: 3px 10px 3px 10px;
     137    top: 10px;
     138    position: relative;
     139    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.28);
     140}
     141.divButton:hover{
     142    color: white;
     143    background: #777777;
     144    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
     145}
     146
     147
     148/*
     149    Global Classes for all Tabs
     150 */
     151
     152
     153.mainLabel{
     154    top: -10px;
     155    left: 10px;
     156    background-color: #f1f1f1;
     157    position: relative;
     158}
     159
     160.important_label{
     161    color: red;
     162}
     163
     164.slider{
     165    -webkit-appearance: none;
     166    width: 100%;
     167    height: 25px;
     168    background: #d3d3d3;
     169    outline: none;
     170    opacity: 0.7;
     171    -webkit-transition: .2s;
     172    transition: opacity .2s;
     173    border-style: solid;
     174    border-color: black;
     175    border-width: 2px;
     176    border-radius: 5px;
     177}
     178
     179.slider::-webkit-slider-thumb {
     180    -webkit-appearance: none;
     181    appearance: none;
     182    top: -5px;
     183    width: 15px;
     184    height: 35px;
     185    background: none;
     186    border-style: solid;
     187    border-color: black;
     188    border-width: 2px;
     189    border-radius: 5px;
     190    cursor: pointer;
     191}
     192
     193.slider::-moz-range-thumb {
     194    top: -5px;
     195    width: 15px;
     196    height: 35px;
     197    background: none;
     198    border-style: solid;
     199    border-color: black;
     200    border-width: 2px;
     201    border-radius: 5px;
     202    cursor: pointer;
     203}
     204
     205
     206
     207
     208.color_slider_bg {
     209    background: -webkit-gradient(linear, left top, right top, from(red), color-stop(17%, #ff0), color-stop(33%, lime), color-stop(50%, cyan), color-stop(66%, blue), color-stop(83%, #f0f), to(red));
     210    background:linear-gradient(to right, red, #ff0 17%, lime 33%, cyan, blue 66%, #f0f 83%, red);
     211}
     212
     213.LinkButton{
     214    text-align: center;
     215    vertical-align: middle;
     216    line-height: 60px;
     217    background: #0073aa;
     218    color: white;
     219    height: 60px;
     220    font-size: 17px;
     221    cursor: pointer;
     222}
     223
     224
     225.hidden{
     226    display: none;
     227}
     228
     229.text_input{
     230    width: 100%;
     231}
  • stapp-video/trunk/includes/db/stapp_video_readData.php

    r2495895 r2500100  
    151151
    152152function checkSTAppVideoCounter(){
    153     $cClass = new STAppVideoCounter();
     153    $cClass = new STAppVideoAdjustment();
    154154    return $cClass->isMax();
    155155}
    156156
    157157function checkSTAppVideoConfigExists(){
    158     $cClass = new STAppVideoCounter();
     158    $cClass = new STAppVideoAdjustment();
    159159    return $cClass->checkExists();
    160160}
    161161
    162 class  STAppVideoCounter{
     162function checkSTAppVideoIsProEnabled(){
     163    $cClass = new STAppVideoAdjustment();
     164    return $cClass->isEnabled();
     165}
     166
     167class STAppVideoAdjustment{
     168
     169
     170    function isEnabled(){
     171        return $this->isProEnabeled();
     172    }
     173
     174
    163175    function isMax(){
     176        if ($this->isProEnabeled()){
     177            return false;
     178        }
    164179        if ($this->getCurrentCounter()>=$this->getMaxLimit()){
    165180            return true;
     
    200215    }
    201216
    202 }
     217    private function isProEnabeled(){
     218         if (get_option('stapp_video_pro_value') == 1){
     219             return true;
     220         }
     221         return false;
     222    }
     223
     224}
  • stapp-video/trunk/includes/db/stapp_video_writeData.php

    r2495895 r2500100  
    101101
    102102}
     103
     104
     105class stapp_video_unlock_plugin{
     106
     107    function unlock($data){
     108        if ($this->checkKey($data)){
     109            $this->setunlockPlugin();
     110        }
     111    }
     112
     113
     114    private function checkKey($data){
     115        $key = 'unlock_key';
     116        if ($this->isKeyIsSet($data, $key)) {
     117            $value = sanitize_key($this->getValue($data,$key));
     118            $GLOBALS['Stapp_Video_Result_Type']["value"] = $this->getValue($data,$key);
     119            $GLOBALS['Stapp_Video_Result_Type']["message"] = $this->checkValue($value);
     120            if (empty($GLOBALS['Stapp_Video_Result_Type']["message"])){
     121                return true;
     122            }
     123        }
     124        return false;
     125    }
     126
     127    private function isKeyIsSet($data, $key){
     128        if ( isset($data[$key]) ){
     129            return true;
     130        }
     131        $GLOBALS['Stapp_Video_Result_Type']["message"] = "You entered no licence key!";
     132        return false;
     133    }
     134
     135    private function getValue($data, $key){
     136        return $data[$key];
     137    }
     138
     139
     140    private function checkValue($value){
     141        if (empty ($value)){
     142           return "You entered no licence key!";
     143        }else {
     144            $value = $this->replaceByKey("-", "", $value);
     145            if ( strlen( $value ) != 16){
     146                return "You entered a incorrect licence key!";
     147            }else{
     148                if ($this->checkValueList(str_split ( $value , 1 ))){
     149                    return "";
     150                } else{
     151                    return "You entered a worng licence key!";
     152                }
     153            }
     154        }
     155    }
     156
     157    private function checkValueList($list){
     158        $i = 0;
     159
     160        $ref = $this->refList();
     161        foreach ($list as $item){
     162            if (chr($ref[$i]) != $item){
     163                return false;
     164            }
     165            $i++;
     166        }
     167        return true;
     168
     169    }
     170
     171
     172    private function refList(){
     173        return [
     174            0 => '114',
     175            1 =>  '117',
     176            2 =>  '53',
     177            3 =>  '103',
     178            4 =>  '114',
     179            5 =>  '56',
     180            6 =>  '103',
     181            7 =>  '101',
     182            8 =>  '97',
     183            9 =>  '114',
     184            10 => '57',
     185            11 => '113',
     186            12 => '118',
     187            13 => '56',
     188            14 => '97',
     189            15 => '122',
     190        ];
     191    }
     192
     193    //replace parameter form list
     194    private function replaceByKey($old, $new, $shortcode_string)
     195    {
     196        $shortcode_string = str_ireplace($old, $new, $shortcode_string);
     197        return $shortcode_string;
     198    }
     199
     200    private function setunlockPlugin(){
     201        update_option('stapp_video_pro_value', 1);
     202    }
     203
     204}
  • stapp-video/trunk/includes/stapp_activate_plugin.php

    r2495895 r2500100  
    66
    77    function activate(){
    8         if (!$this->isActivated()){
    9             $this->createVideoTable();
    10             $this->setVersion();
    11             $this->setCounter();
    12             $this->setDefaultVideoWidth();
    13             $this->setSTappVideoDesignModus();
    14         }
     8        $this->createVideoTable();
     9        $this->setVersion();
     10        $this->setCounter();
     11        $this->setDefaultVideoWidth();
     12        $this->setSTappVideoDesignModus();
     13        $this->setSTappVideoDesignProValue();
    1514    }
    1615
    1716
    1817    private function createVideoTable(){
    19         $class = new stapp_video_create_tables();
    20         $class->createTable();
     18        if (!$this->isOptionActivated('stapp_video_version')) {
     19            $class = new stapp_video_create_tables();
     20            $class->createTable();
     21        }
    2122    }
    2223
     
    2425    private function setVersion(){
    2526        static $stapp_tbl_version = 100;
    26         add_option( 'stapp_video_version', $stapp_tbl_version );
     27        $this->checkOption( 'stapp_video_version', $stapp_tbl_version );
    2728    }
    2829
    2930    private function setCounter(){
    3031        static $stapp_counter = 1;
    31         add_option( 'stapp_video_counter', $stapp_counter );
     32        $this->checkOption( 'stapp_video_counter', $stapp_counter );
    3233    }
    3334
    3435    private function setDefaultVideoWidth(){
    3536
    36         add_option( 'stapp_video_phone_default_breakpoint', 0 );
    37         add_option( 'stapp_video_tablet_default_breakpoint', 500 );
    38         add_option( 'stapp_video_desktop_default_breakpoint', 960 );
    39         add_option( 'stapp_video_desktop_hd_default_breakpoint', 1200 );
    40         add_option( 'stapp_video_desktop_4k_default_breakpoint', 1600 );
     37        $this->checkOption( 'stapp_video_phone_default_breakpoint', 0 );
     38        $this->checkOption( 'stapp_video_tablet_default_breakpoint', 500 );
     39        $this->checkOption( 'stapp_video_desktop_default_breakpoint', 960 );
     40        $this->checkOption( 'stapp_video_desktop_hd_default_breakpoint', 1200 );
     41        $this->checkOption( 'stapp_video_desktop_4k_default_breakpoint', 1600 );
    4142    }
    4243
    4344
    4445    private function setSTappVideoDesignModus(){
    45         add_option( 'stapp_video_design_modus', 0 );
     46        $this->checkOption( 'stapp_video_design_modus', 0 );
     47    }
     48
     49    private function setSTappVideoDesignProValue(){
     50        $this->checkOption( 'stapp_video_pro_value', 0 );
    4651    }
    4752
    4853
     54    private function checkOption($optionKey,$initalValue){
     55        if (!$this->isOptionActivated($optionKey)){
     56            $this->setOption($optionKey, $initalValue);
     57        }
     58    }
    4959
    50     private function isActivated(){
    51         $option = trim( get_option('stapp_video_counter'));
     60    private function setOption($optionKey,$initalValue) {
     61        add_option( $optionKey, $initalValue );
     62    }
     63
     64
     65    private function isOptionActivated($optionKey){
     66        $option = trim( get_option($optionKey));
    5267        if ( empty( $option ) ) {
    5368            return false;
  • stapp-video/trunk/readme.txt

    r2495988 r2500100  
    66Tested up to: 5.7
    77Requires PHP: 7.0
    8 Stable tag: 1.0
     8Stable tag: 1.1
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3333== Questions & Support ==
    3434
    35 For more informations, please visit us at: [dev-wordpress.com](https://dev-wordpress.com/)
    36 If you have any questions, please contact us Mail(mailto:[email protected] "[email protected]")
     35For more informations, please visit us at: [dev-wordpress.com](https://dev-wordpress.com/produkt/video/)
     36If you have any questions, please [contact us directly](https://dev-wordpress.com/contact/)
     37
    3738
    3839== Changelog ==
    3940
     41
     42= 1.1 =
     43
     44 * Enable Support for Pro Version
     45 * Minor Bugfixes
     46
    4047= 1.0 =
    4148
     49 * Initial release
    4250
    4351
    44 
  • stapp-video/trunk/stapp_video.php

    r2495897 r2500100  
    77Plugin URI: https://dev-wordpress.com/forum/
    88Description: Insert videos on any postion via shortcode
    9 Version: 1.0
     9Version: 1.1
    1010Author: STApp Professional GmbH
    1111Author URI: https://stapp-professional.de
     
    2424
    2525
    26 define( 'STAPP_VIDEO_VERSION', '1.0' );
     26define( 'STAPP_VIDEO_VERSION', '1.1' );
    2727
    2828define( 'STAPP_VIDEO_REQUIRED_WP_VERSION', '5.7' );
Note: See TracChangeset for help on using the changeset viewer.