-
Notifications
You must be signed in to change notification settings - Fork 2
/
link-verification-for-mastodon.php
121 lines (104 loc) · 3.58 KB
/
link-verification-for-mastodon.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* Plugin Name: Link Verification for Mastodon
* Plugin URI: https://over-engineer.com/projects/link-verification-for-mastodon
* Description: A WordPress plugin to quickly verify a link on your Mastodon profile.
* Version: 1.1.4
* Author: overengineer
* Author URI: https://over-engineer.com/
* Text Domain: link-verification-for-mastodon
* Domain Path: /languages
* License: GPLv2
*
* Link Verification for Mastodon
* A WordPress plugin to quickly verify a link on your Mastodon profile.
* Copyright (c) 2022 over-engineer
*
* Link Verification for Mastodon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* any later version.
*
* Link Verification for Mastodon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Link Verification for Mastodon. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright 2022 Konstantinos Pappas <[email protected]>
*/
namespace OverEngineer\Mastodon\LinkVerification;
if ( ! defined( 'ABSPATH' ) ) {
die( 'Forbidden' );
}
if ( ! class_exists( 'Plugin' ) ) :
/**
* Plugin class.
*
* @since 1.0.0
*/
final class Plugin {
/**
* @var string Plugin version number.
*/
private $version = '1.1.4';
/**
* @return void
*/
public function load_textdomain() {
load_plugin_textdomain(
'link-verification-for-mastodon',
false, // this parameter is deprecated
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
}
/**
* Setup plugin constants.
*
* @return void
*/
public function setup_constants() {
if ( ! defined( 'OverEngineer\Mastodon\LinkVerification\VERSION' ) ) {
define( 'OverEngineer\Mastodon\LinkVerification\VERSION', $this->version );
}
if ( ! defined( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_DIR' ) ) {
define( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_URL' ) ) {
define( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_FILE' ) ) {
define( 'OverEngineer\Mastodon\LinkVerification\PLUGIN_FILE', __FILE__ );
}
}
/**
* Require files.
*
* @return void
*/
public function require_files() {
require_once __DIR__ . '/includes/class-utils.php';
require_once __DIR__ . '/admin/settings.php';
require_once __DIR__ . '/includes/verification-tag.php';
}
/**
* Plugin constructor.
*/
public function __construct() {
$this->load_textdomain();
$this->setup_constants();
$this->require_files();
}
}
endif;
/**
* Load the plugin.
*
* @return void
*/
function load_plugin() {
new Plugin();
}
add_action( 'plugins_loaded', 'OverEngineer\Mastodon\LinkVerification\load_plugin' );