- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
178 lines
4.2 KiB
PHP
Executable File
178 lines
4.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* @package rss-feed
|
|
* @version 1.9
|
|
*/
|
|
/*
|
|
|
|
/*
|
|
Plugin Name: RSS Feed
|
|
|
|
Description: RSS google Feed.
|
|
Version: 1.9
|
|
Author: rajawi
|
|
|
|
|
|
Copyright 2021 - rajawi
|
|
|
|
*/
|
|
|
|
if ( !function_exists( 'add_action' ) ) {
|
|
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
|
|
exit;
|
|
}
|
|
add_action('admin_head', 'header_rss_feed');
|
|
add_action('admin_footer', 'footer_rss_feed');
|
|
add_action('admin_menu', 'rss_feed_menu');
|
|
|
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
|
|
|
|
define( 'rssfeed__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
define( 'rssfeed__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'rssfeed__SEO_URL',str_replace("plugins/","",rssfeed__PLUGIN_URL) );
|
|
|
|
|
|
|
|
function rss_feed_menu() {
|
|
add_menu_page('RSS Feed', 'RSS Feed', 'administrator', 'rss_feed_menu', 'rss_feed_page', 'dashicons-dashboard');
|
|
|
|
}
|
|
|
|
|
|
function rss_feed_page() {
|
|
admin_templ("rss_feed");
|
|
?>
|
|
<script>
|
|
jQuery(document).ready(function(){
|
|
list_admin('rss_feed');
|
|
});
|
|
</script>
|
|
<?php
|
|
|
|
}
|
|
|
|
function admin_templ($temp)
|
|
{
|
|
?>
|
|
<div id="auto_servies_page" class="content-area">
|
|
<main id="main" class="site-main" role="main">
|
|
|
|
<div class="notice notice-error notice-alt inline hidden raj_notice" id="error_raj" >
|
|
<p class="error"></p>
|
|
</div>
|
|
<div class="notice notice-success notice-alt inline hidden raj_notice" id="success_raj" >
|
|
<p class="success"></p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="auto_servies_div" style="min-height:700px">
|
|
|
|
</div>
|
|
|
|
|
|
</main><!-- #main -->
|
|
</div><!-- #primary -->
|
|
<?php
|
|
}
|
|
function footer_rss_feed() {
|
|
|
|
|
|
echo "<script type='text/javascript' src='".rssfeed__PLUGIN_URL."js/ejs.min.js'></script>";
|
|
echo "<script type='text/javascript' src='".rssfeed__PLUGIN_URL."js/functions.js'></script>";
|
|
|
|
echo "<link rel='stylesheet' href='".rssfeed__PLUGIN_URL."css/my-style.css' type='text/css' media='all' />";
|
|
echo '<div class="ajax-loader">
|
|
<img src="'.rssfeed__PLUGIN_URL.'images/loading.gif" />
|
|
</div>';
|
|
//wp_enqueue_script( "inline_edit","/wp-admin/js/inline-edit-post.min.js", array(),false, true );
|
|
|
|
|
|
}
|
|
|
|
function header_rss_feed() {
|
|
|
|
echo "<script>
|
|
|
|
var my_ajax_url='". rssfeed__PLUGIN_URL."ajax.php';
|
|
var plugin_url='". rssfeed__PLUGIN_URL."';
|
|
var plugin_seo_url='".rssfeed__SEO_URL."';
|
|
var user_id='".get_current_user_id()."';
|
|
var my_site_url='".get_site_url()."/';
|
|
var site_name='".get_bloginfo("name")."';
|
|
</script>";
|
|
|
|
|
|
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
$current_page_rajawi_admin=false;
|
|
if(isset($_REQUEST["page"]))
|
|
{
|
|
|
|
|
|
|
|
|
|
$mypages=array('rss_feed_menu');
|
|
if(in_array($_REQUEST["page"],$mypages))
|
|
$current_page_rajawi_admin=true;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Runs when plugin is activated */
|
|
register_activation_hook(__FILE__,'my_plugin_install');
|
|
|
|
/* Runs on plugin deactivation*/
|
|
register_deactivation_hook( __FILE__, 'my_plugin_remove' );
|
|
|
|
function my_plugin_install() {
|
|
|
|
|
|
|
|
import_tables("tables.sql");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
function import_tables($filename,$tables = '*'){
|
|
$filename= rssfeed__PLUGIN_DIR.$filename;
|
|
require_once(rssfeed__PLUGIN_DIR."/includes.php");
|
|
if ($result = $db->db_query("SHOW TABLES LIKE 'rss_feed'")) {
|
|
if($result->num_rows == 1) {
|
|
//$db->db_query("DROP TABLE `rss_feed`");
|
|
return true;
|
|
}
|
|
}
|
|
$templine = '';
|
|
$lines = file($filename); // Read entire file
|
|
|
|
foreach ($lines as $line){
|
|
// Skip it if it's a comment
|
|
if (substr($line, 0, 2) == '--' || $line == '' || substr($line, 0, 2) == '/*' )
|
|
continue;
|
|
|
|
// Add this line to the current segment
|
|
$templine .= $line;
|
|
// If it has a semicolon at the end, it's the end of the query
|
|
if (substr(trim($line), -1, 1) == ';')
|
|
{
|
|
$db->db_query($templine);
|
|
|
|
$templine = '';
|
|
}
|
|
}
|
|
|
|
}
|
|
function my_plugin_remove()
|
|
{
|
|
}
|
|
|
|
?>
|