-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
squidge.php
57 lines (49 loc) · 1.4 KB
/
squidge.php
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
<?php
/**
* Plugin Name: Squidge
* Plugin URI: https://github.com/ainsleyclark/squidge
* Description: A image optimisation plugin to compress and convert images using cwebp, jpegoptim, optipng and libavif.
* Author: Ainsley Clark
* Author URI: https://github.com/ainsleyclark
* Text Domain: squidge
* Version: 0.1.4
* License: GNU
*
* @package Squidge
* @repo https://github.com/ainsleyclark/squidge
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
// Require autoload.
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require(__DIR__ . '/vendor/autoload.php');
}
// Boot Squidge (Once).
Squidge\Squidge::boot();
// Require CLI.
if (file_exists(__DIR__ . '/cli/Commands.php')) {
require(__DIR__ . '/cli/Commands.php');
}
// Require Functions.
if (file_exists(__DIR__ . '/functions/functions.php')) {
require(__DIR__ . '/functions/functions.php');
}
if (!function_exists('squidge_add_settings_link')) {
/**
* Add Settings Link.
*
* @param $links
* @return mixed
* @since 0.1.0
* @date 24/11/2021
*/
function squidge_add_settings_link($links)
{
$links[] = '<a href="' .
admin_url('options-general.php?page=crb_carbon_fields_container_squidge.php') .
'">' . __('Settings') . '</a>';
return $links;
}
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'squidge_add_settings_link');
}