Tan-007 /
myslideshow
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | /** |
||||||
| 4 | * The plugin bootstrap file |
||||||
| 5 | * |
||||||
| 6 | * This file is read by WordPress to generate the plugin information in the plugin |
||||||
| 7 | * admin area. This file also includes all of the dependencies used by the plugin, |
||||||
| 8 | * registers the activation and deactivation functions, and defines a function |
||||||
| 9 | * that starts the plugin |
||||||
| 10 | * |
||||||
| 11 | * @link rahicodes.wordpress.com |
||||||
| 12 | * @since 1.0.1 |
||||||
| 13 | * @package Myslideshow |
||||||
| 14 | * |
||||||
| 15 | * @wordpress-plugin |
||||||
| 16 | * Plugin Name: MySlideShow |
||||||
| 17 | * Plugin URI: rahicodes.wordpress.com |
||||||
| 18 | * Description: This plugin allows you to display a fully functional and responsive slideshow anywhere in your site by just using a shortcode! |
||||||
| 19 | * Version: 1.0.3 |
||||||
| 20 | * Author: Rahi Prajapati |
||||||
| 21 | * Author URI: rahicodes.wordpress.com |
||||||
| 22 | * License: GPL-2.0+ |
||||||
| 23 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
||||||
| 24 | * Text Domain: myslideshow |
||||||
| 25 | * Domain Path: /languages |
||||||
| 26 | */ |
||||||
| 27 | |||||||
| 28 | // If this file is called directly, abort. |
||||||
| 29 | if ( ! defined( 'WPINC' ) ) { |
||||||
| 30 | die; |
||||||
| 31 | } |
||||||
| 32 | |||||||
| 33 | /** |
||||||
| 34 | * Currently plugin version. |
||||||
| 35 | * Start at version 1.0.0 and use SemVer - https://semver.org |
||||||
| 36 | * Rename this for your plugin and update it as you release new versions. |
||||||
| 37 | */ |
||||||
| 38 | define( 'MYSLIDESHOW_VERSION', '1.0.3' ); |
||||||
| 39 | |||||||
| 40 | /** |
||||||
| 41 | * Global options |
||||||
| 42 | */ |
||||||
| 43 | $defaults = array( |
||||||
| 44 | 'image_urls' => '', |
||||||
| 45 | 'images_number' => '0', |
||||||
| 46 | ); |
||||||
| 47 | $slides_options = get_option( 'mss_settings', $defaults ); |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 48 | |||||||
| 49 | if ( $slides_options == '' ) { |
||||||
| 50 | update_option( 'mss_settings', $defaults ); |
||||||
|
0 ignored issues
–
show
The function
update_option was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 51 | } |
||||||
| 52 | |||||||
| 53 | /** |
||||||
| 54 | * The code that runs during plugin activation. |
||||||
| 55 | * This action is documented in includes/class-myslideshow-activator.php |
||||||
| 56 | */ |
||||||
| 57 | function activate_myslideshow() { |
||||||
| 58 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-myslideshow-activator.php'; |
||||||
|
0 ignored issues
–
show
The function
plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 59 | Myslideshow_Activator::activate(); |
||||||
| 60 | } |
||||||
| 61 | |||||||
| 62 | /** |
||||||
| 63 | * The code that runs during plugin deactivation. |
||||||
| 64 | * This action is documented in includes/class-myslideshow-deactivator.php |
||||||
| 65 | */ |
||||||
| 66 | function deactivate_myslideshow() { |
||||||
| 67 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-myslideshow-deactivator.php'; |
||||||
|
0 ignored issues
–
show
The function
plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 68 | Myslideshow_Deactivator::deactivate(); |
||||||
| 69 | } |
||||||
| 70 | |||||||
| 71 | register_activation_hook( __FILE__, 'activate_myslideshow' ); |
||||||
|
0 ignored issues
–
show
The function
register_activation_hook was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 72 | register_deactivation_hook( __FILE__, 'deactivate_myslideshow' ); |
||||||
|
0 ignored issues
–
show
The function
register_deactivation_hook was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 73 | |||||||
| 74 | /** |
||||||
| 75 | * The core plugin class that is used to define internationalization, |
||||||
| 76 | * admin-specific hooks, and public-facing site hooks. |
||||||
| 77 | */ |
||||||
| 78 | require plugin_dir_path( __FILE__ ) . 'includes/class-myslideshow.php'; |
||||||
|
0 ignored issues
–
show
The function
plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 79 | |||||||
| 80 | /** |
||||||
| 81 | * Begins execution of the plugin. |
||||||
| 82 | * |
||||||
| 83 | * Since everything within the plugin is registered via hooks, |
||||||
| 84 | * then kicking off the plugin from this point in the file does |
||||||
| 85 | * not affect the page life cycle. |
||||||
| 86 | * |
||||||
| 87 | * @since 1.0.0 |
||||||
| 88 | */ |
||||||
| 89 | function run_myslideshow() { |
||||||
| 90 | |||||||
| 91 | $plugin = new Myslideshow(); |
||||||
| 92 | $plugin->run(); |
||||||
| 93 | |||||||
| 94 | } |
||||||
| 95 | run_myslideshow(); |
||||||
| 96 |