PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 3.8.6
Social Media Auto Poster – Schedule & Publish to Buffer v3.8.6
6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 All 124 releases
wp-to-buffer / wp-to-buffer.php

wp-to-buffer.php in Social Media Auto Poster – Schedule & Publish to Buffer 3.8.6, at wp-to-buffer.php

113 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WP to Buffer WordPress Plugin.
4 *
5 * @package WP_To_Buffer
6 * @author WP Zinc
7 *
8 * @wordpress-plugin
9 * Plugin Name: WP to Buffer
10 * Plugin URI: http://www.wpzinc.com/plugins/wp-to-buffer-pro
11 * Version: 3.8.6
12 * Author: WP Zinc
13 * Author URI: http://www.wpzinc.com
14 * Description: Send WordPress Pages, Posts or Custom Post Types to your Buffer (buffer.com) account for scheduled publishing to social networks.
15 * Text Domain: wp-to-buffer
16 */
17
18 // Bail if Plugin is alread loaded.
19 if ( class_exists( 'WP_To_Buffer' ) ) {
20 return;
21 }
22
23 // Define Plugin version and build date.
24 define( 'WP_TO_BUFFER_PLUGIN_VERSION', '3.8.6' );
25 define( 'WP_TO_BUFFER_PLUGIN_BUILD_DATE', '2023-05-16 18:00:00' );
26
27 // Define Plugin paths.
28 define( 'WP_TO_BUFFER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
29 define( 'WP_TO_BUFFER_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
30
31 /**
32 * Define the autoloader for this Plugin
33 *
34 * @since 3.4.7
35 *
36 * @param string $class_name The class to load.
37 */
38 function WP_To_Buffer_Autoloader( $class_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
39
40 // Define the required start of the class name.
41 $class_start_name = 'WP_To_Social_Pro';
42
43 // Get the number of parts the class start name has.
44 $class_parts_count = count( explode( '_', $class_start_name ) );
45
46 // Break the class name into an array.
47 $class_path = explode( '_', $class_name );
48
49 // Bail if it's not a minimum length (i.e. doesn't potentially have WP_To_Social_Pro).
50 if ( count( $class_path ) < $class_parts_count ) {
51 return;
52 }
53
54 // Build the base class path for this class.
55 $base_class_path = '';
56 for ( $i = 0; $i < $class_parts_count; $i++ ) {
57 $base_class_path .= $class_path[ $i ] . '_';
58 }
59 $base_class_path = trim( $base_class_path, '_' );
60
61 // Bail if the first parts don't match what we expect.
62 if ( $base_class_path !== $class_start_name ) {
63 return;
64 }
65
66 // Define the file name.
67 $file_name = 'class-' . str_replace( '_', '-', strtolower( $class_name ) ) . '.php';
68
69 // Define the paths to search for the file.
70 $include_paths = array(
71 WP_TO_BUFFER_PLUGIN_PATH . 'lib/includes',
72 WP_TO_BUFFER_PLUGIN_PATH . 'includes',
73 );
74
75 // Iterate through the include paths to find the file.
76 foreach ( $include_paths as $path ) {
77 if ( file_exists( $path . '/' . $file_name ) ) {
78 require_once $path . '/' . $file_name;
79 return;
80 }
81 }
82
83 }
84 spl_autoload_register( 'wp_to_buffer_autoloader' );
85
86 // Load Activation, Cron and Deactivation functions.
87 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/activation.php';
88 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/cron.php';
89 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/deactivation.php';
90 register_activation_hook( __FILE__, 'wp_to_buffer_activate' );
91 if ( version_compare( get_bloginfo( 'version' ), '5.1', '>=' ) ) {
92 add_action( 'wp_insert_site', 'wp_to_buffer_activate_new_site' );
93 } else {
94 add_action( 'wpmu_new_blog', 'wp_to_buffer_activate_new_site' );
95 }
96 add_action( 'activate_blog', 'wp_to_buffer_activate_new_site' );
97 register_deactivation_hook( __FILE__, 'wp_to_buffer_deactivate' );
98
99 /**
100 * Main function to return Plugin instance.
101 *
102 * @since 3.8.1
103 */
104 function WP_To_Buffer() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
105
106 return WP_To_Buffer::get_instance();
107
108 }
109
110 // Finally, initialize the Plugin.
111 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/class-wp-to-buffer.php';
112 $wp_to_buffer = WP_To_Buffer();
113