PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.1.2
Social Media Auto Poster – Schedule & Publish to Buffer v6.1.2
6.2.4 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 All 125 releases
wp-to-buffer / wp-to-buffer.php

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

121 lines 3.6 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: 6.1.2
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 * License: GPLv3 or later
17 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
18 */
19
20 if ( ! defined( 'ABSPATH' ) ) {
21 exit; // Exit if accessed directly.
22 }
23
24 // Bail if Plugin is alread loaded.
25 if ( class_exists( 'WP_To_Buffer' ) ) {
26 return;
27 }
28
29 // Define Plugin version and build date.
30 define( 'WP_TO_BUFFER_PLUGIN_VERSION', '6.1.2' );
31 define( 'WP_TO_BUFFER_PLUGIN_BUILD_DATE', '2026-07-10 20:00:00' );
32
33 // Define Plugin paths.
34 define( 'WP_TO_BUFFER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
35 define( 'WP_TO_BUFFER_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
36
37 /**
38 * Define the autoloader for this Plugin
39 *
40 * @since 3.4.7
41 *
42 * @param string $class_name The class to load.
43 */
44 function WP_To_Buffer_Autoloader( $class_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
45
46 // Define the required start of the class name.
47 $class_start_name = 'WP_To_Social_Pro';
48
49 // Get the number of parts the class start name has.
50 $class_parts_count = count( explode( '_', $class_start_name ) );
51
52 // Break the class name into an array.
53 $class_path = explode( '_', $class_name );
54
55 // Bail if it's not a minimum length (i.e. doesn't potentially have WP_To_Social_Pro).
56 if ( count( $class_path ) < $class_parts_count ) {
57 return;
58 }
59
60 // Build the base class path for this class.
61 $base_class_path = '';
62 for ( $i = 0; $i < $class_parts_count; $i++ ) {
63 $base_class_path .= $class_path[ $i ] . '_';
64 }
65 $base_class_path = trim( $base_class_path, '_' );
66
67 // Bail if the first parts don't match what we expect.
68 if ( $base_class_path !== $class_start_name ) {
69 return;
70 }
71
72 // Define the file name.
73 $file_name = 'class-' . str_replace( '_', '-', strtolower( $class_name ) ) . '.php';
74
75 // Define the paths to search for the file.
76 $include_paths = array(
77 WP_TO_BUFFER_PLUGIN_PATH . 'lib/includes',
78 WP_TO_BUFFER_PLUGIN_PATH . 'lib/includes/integrations',
79 WP_TO_BUFFER_PLUGIN_PATH . 'includes',
80 );
81
82 // Iterate through the include paths to find the file.
83 foreach ( $include_paths as $path ) {
84 if ( file_exists( $path . '/' . $file_name ) ) {
85 require_once $path . '/' . $file_name;
86 return;
87 }
88 }
89
90 }
91 spl_autoload_register( 'wp_to_buffer_autoloader' );
92
93 // Load Activation, Cron and Deactivation functions.
94 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/activation.php';
95 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/cron.php';
96 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/functions.php';
97 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/deactivation.php';
98 register_activation_hook( __FILE__, 'wp_to_buffer_activate' );
99 if ( version_compare( get_bloginfo( 'version' ), '5.1', '>=' ) ) {
100 add_action( 'wp_insert_site', 'wp_to_buffer_activate_new_site' );
101 } else {
102 add_action( 'wpmu_new_blog', 'wp_to_buffer_activate_new_site' );
103 }
104 add_action( 'activate_blog', 'wp_to_buffer_activate_new_site' );
105 register_deactivation_hook( __FILE__, 'wp_to_buffer_deactivate' );
106
107 /**
108 * Main function to return Plugin instance.
109 *
110 * @since 3.8.1
111 */
112 function WP_To_Buffer() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
113
114 return WP_To_Buffer::get_instance();
115
116 }
117
118 // Finally, initialize the Plugin.
119 require_once WP_TO_BUFFER_PLUGIN_PATH . 'includes/class-wp-to-buffer.php';
120 $wp_to_buffer = WP_To_Buffer();
121