-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalt-manager.php
More file actions
95 lines (86 loc) · 3.51 KB
/
alt-manager.php
File metadata and controls
95 lines (86 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* @package ALM
* @author Mohamed Saad
* @link https://wpsaad.com
* @since 1.0.0
*/
/**
* Plugin Name: Alt Manager
* plugin URI: https://wpsaad.com/alt-manager-wordpress-image-alt-text-plugin
* Description: Alt Manager bulk generate and change images Alt and Title attributes for WordPress images and fix empty values to a dynamic related values.
* Version: 1.4.5
* Author: Mohamed Saad
* Author URI: https://wpsaad.com
* License: GPLv2 or later
* Text Domain: alt-manager
* Domain Path: /languages
*/
defined( 'ABSPATH' ) or die;
if ( function_exists( 'am_fs' ) ) {
am_fs()->set_basename( false, __FILE__ );
} else {
if ( !function_exists( 'am_fs' ) ) {
// Create a helper function for easy SDK access.
function am_fs()
{
global $am_fs ;
if ( !isset( $am_fs ) ) {
// Include Freemius SDK.
require_once dirname( __FILE__ ) . '/freemius/start.php';
$am_fs = fs_dynamic_init( array(
'id' => '5548',
'slug' => 'alt-manager',
'type' => 'plugin',
'navigation' => 'tabs',
'public_key' => 'pk_07c4f76da780308f88546ce3da78a',
'is_premium' => false,
'premium_suffix' => 'premium plan',
'has_addons' => false,
'has_paid_plans' => true,
'menu' => array(
'slug' => 'alt-manager',
'parent' => array(
'slug' => 'options-general.php',
),
),
'is_live' => true,
) );
}
return $am_fs;
}
// Init Freemius.
am_fs();
// Signal that SDK was initiated.
do_action( 'am_fs_loaded' );
}
//add style
add_action( 'admin_enqueue_scripts', 'alm_style' );
function alm_style()
{
wp_enqueue_script( 'select2-script', plugins_url( '/assets/js/select2.min.js', __FILE__ ) );
wp_enqueue_style( 'select2-style', plugins_url( '/assets/css/select2.min.css', __FILE__ ) );
wp_enqueue_script( 'alm-admin-script', plugins_url( '/assets/js/alm-admin-script.js', __FILE__ ) );
wp_enqueue_style( 'alm-admin-style', plugins_url( '/assets/css/alm-admin-styles.css', __FILE__ ) );
if ( is_rtl() ) {
wp_enqueue_style( 'alm-admin-style-rtl', plugins_url( '/assets/css/alm-admin-styles-rtl.css', __FILE__ ) );
}
// wp_enqueue_script('jquery-ui-sortable');
}
//load plugin required files
add_action( 'init', 'alm_load' );
function alm_load()
{
$current_user = wp_get_current_user();
require_once plugin_dir_path( __FILE__ ) . 'inc/alm-functions.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/alm-empty-generator.php';
require_once plugin_dir_path( __FILE__ ) . 'inc/alm-activate.php';
register_activation_hook( __FILE__, array( 'almActivate', 'activate' ) );
if ( user_can( $current_user, 'manage_options' ) ) {
include_once plugin_dir_path( __FILE__ ) . 'inc/alm-admin.php';
}
if ( !function_exists( 'file_get_html' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'inc/simple_html_dom.php';
}
}
}