Plugin Directory

Changeset 2148498


Ignore:
Timestamp:
08/30/2019 02:07:38 PM (6 years ago)
Author:
118group
Message:

v 1.5

Location:
team-118group-agent/trunk
Files:
21 added
3 edited

Legend:

Unmodified
Added
Removed
  • team-118group-agent/trunk/modules/hooks.php

    r2143202 r2148498  
    11<?php
     2   
     3// gravity form entries listing
    24add_action('rest_api_init', function () {
    35  register_rest_route( 'gfdata/v1', 'date/(?P<date>[a-zA-Z0-9-]+)',array(
     
    5254     
    5355        $out_entry[] = array(
     56        'submission_id' => $single_item->id,
    5457        'form_id' => $single_item->form_id,
     58       
    5559        'form_title' => $form_title->title,
    5660        'form_is_active' => $form_title->is_active,
     
    7276}
    7377
    74 
     78// Alog plugin log return
    7579add_action('rest_api_init', function () {
    7680  register_rest_route( 'alog/v1', 'date/(?P<date>[a-zA-Z0-9-]+)',array(
     
    128132}
    129133
     134// sitemap generation
     135add_action('rest_api_init', function () {
     136  register_rest_route( 'sitemap/v1', '/generate',array(
     137                'methods'  => 'GET',
     138                'callback' => 'wtgaf_generate_sitemap'
     139      ));
     140});
     141
     142function wtgaf_generate_sitemap($request) {
     143    global $wpdb;
     144 
     145   
     146    $args = array(
     147        'showposts' => -1,
     148        'post_type' => 'any'
     149    );
     150    $all_posts = get_posts($args);
     151   
     152    $json_sitemap = array();
     153   
     154    if( count( $all_posts ) > 0 ){
     155        foreach( $all_posts as $single_post ){
     156           
     157            $json_sitemap[] = array(
     158                'url' => get_permalink( $single_post->ID ),
     159                'post_type' => $single_post->post_type,
     160                'last_mod' => $single_post->post_modified
     161           
     162            );
     163           
     164            }
     165        }
     166   
     167   
     168    $response = new WP_REST_Response( $json_sitemap );
     169    $response->set_status(200);
     170
     171    return $response;
     172   
     173   
     174}
     175
     176
     177// insertin link to plugin
     178add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'wtgaf_add_action_links' );
     179function wtgaf_add_action_links ( $links ) {
     180    $mylinks = array(
     181    '<a href="' . admin_url( 'options-general.php?page=myplugin' ) . '">Usage Info</a>',
     182    );
     183    return array_merge( $links, $mylinks );
     184}
     185
     186
     187// 404 functionality
     188add_Action('template_redirect', 'wtf_template_redirect');
     189function wtf_template_redirect(){
     190    if( is_404() ){
     191        global $wp, $wpdb;
     192       
     193        $table_name = 'wtf_404_log';
     194        $table_name =  $wpdb->prefix.$table_name;   
     195           
     196 
     197       
     198        $current_url = home_url(add_query_arg(array(), $wp->request));
     199        date_default_timezone_set('US/Eastern');
     200       
     201        // check if exists
     202       
     203         
     204       
     205        $res = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE request_url = %s", $current_url) );
     206 
     207        if( count($res) == 0 ){
     208            $res = $wpdb->insert(
     209                $table_name,
     210                array(
     211                    'request_url' => $current_url ,
     212                    'refferal_url' =>   ( $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : '' ),
     213                    'timestamp' => time() ,
     214                 
     215                ),
     216                array( 
     217                    '%s',
     218                    '%s',
     219                    '%d'
     220                )
     221            ); 
     222             
     223        }
     224    }
     225}
    130226
    131227?>
  • team-118group-agent/trunk/readme.txt

    r2143535 r2148498  
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    9 Stable tag: 1.3.2
    10 Version: 1.3.2
     9Stable tag: 1.5
     10Version: 1.5
    1111
    1212Performs a variety of functions to assist your web designer with wordpress data and system care
     
    1515
    1616This plugin can be called and displays Gravity Forms Entries Using a simple URL: https://www.mydomain.com/wp-json/gfdata/v1/date/MM-DD-YYYY
     17
     18This plugin can be called and displays WP Security Audit Log Entries Using a simple URL: https://www.mydomain.com/wp-json/alog/v1/date/MM-DD-YYYY
     19
     20This plugin can be called and displays JSON Sitemap using a simple URL: https://www.mydomain.com/wp-json/sitemap/v1/generate
     21
     22
    1723
    1824Replace MM-DD-YYYY with any date and only entries on or after that date will be displayed.
  • team-118group-agent/trunk/wp-tga-filter.php

    r2143535 r2148498  
    33Plugin Name: Team 118GROUP Agent
    44Description: Team 118GROUP Web Design Plugin to assist with monitoring your WordPress installation and assisting with system care
    5 Version: 1.3.2
     5Version: 1.5
    66Author: Team118GROUP
    77Author URI: http://www.118group.com
    8 Stable tag: 1.3.2
     8Stable tag: 1.5
    99*/
    1010
     
    4141new vooMainStart('wtf', array(
    4242    'modules/hooks.php',
     43    'modules/ajax.php',
     44    'modules/settings.php',
     45    'modules/scripts.php',
    4346), dirname(__FILE__).'/' );
     47
     48 
     49register_activation_hook( __FILE__, 'wtf_activate' );
     50function wtf_activate() {
     51require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
     52 global $wpdb;
     53 $table_name = 'wtf_404_log';
     54 $table_name =  $wpdb->prefix.$table_name;
     55 
     56 
     57 $wpdb->query("DROP TABLE ".$table_name );
     58
     59$sql = "CREATE TABLE IF NOT EXISTS $table_name (
     60  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
     61  `request_url` longtext NOT NULL ,
     62  `refferal_url` longtext NOT NULL,
     63  `timestamp` longtext NOT NULL,
     64  `redirect_url` longtext NOT NULL,
     65 
     66  UNIQUE KEY `id` (`id`)
     67) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";
     68
     69dbDelta($sql);
    4470
    4571 
    4672
    4773
     74}
     75
    4876 
    4977?>
Note: See TracChangeset for help on using the changeset viewer.