-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cord concept. Cleaned up code and verbatim. New issue templates.
- Loading branch information
Showing
46 changed files
with
1,620 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contributing to the Extension Manager | ||
|
||
Please see [The SEO Framework's CONTRIBUTING.md](https://github.com/sybrew/the-seo-framework/blob/master/.github/CONTRIBUTING.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: "\U0001F46E Security issue" | ||
about: "Please report security issues at https://theseoframework.com/contact/." | ||
title: '' | ||
labels: '' | ||
assignees: sybrew | ||
|
||
--- | ||
|
||
Please disclose security issues responsibly and not publicly via GitHub. | ||
|
||
So, for security reasons, please report all security issues via https://theseoframework.com/contact/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: "\U0001F4A1 Enhancement idea" | ||
about: "We'd love to know what could've been done better in the Extension Manager." | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- Found room for improvement on existing features? Or do you think a new feature should be added? Let us know! --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
name: "\U0001F680 Feature request" | ||
about: "Suggest a new feature for the Extension Manager." | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
For increased exposure, features requests should be sent to the main project: | ||
https://github.com/sybrew/the-seo-framework/issues/new | ||
|
||
Feature requests here will be closed. | ||
<!-- We'd love to know what we can add! Please elaborate why you think this feature is useful. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
--- | ||
name: Support | ||
about: Describe your issue clear and concise | ||
name: "\U0001F4AC Support" | ||
about: "Are you running into issues with the Extension Manager? Reach out to us here." | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- Keep it short and sweet! --> | ||
<!-- Please keep your inquiry short! --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## Packages | ||
*.zip | ||
*.7z | ||
*.gz | ||
*.tar | ||
*.rar | ||
|
||
## Local storage | ||
*.log | ||
*.ser | ||
*.sql | ||
*.sqlite | ||
|
||
## Common work-file extensions | ||
*.tmp | ||
*.bak | ||
|
||
## OS generated files | ||
.DS_Store | ||
.DS_Store? | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<?php | ||
/** | ||
* @package TSF_Extension_Manager\Extension\Cord | ||
*/ | ||
namespace TSF_Extension_Manager\Extension\Cord; | ||
|
||
/** | ||
* Extension Name: Cord | ||
* Extension URI: https://theseoframework.com/extensions/cord/ | ||
* Extension Description: The Cord extension connects your website to search engines, so they can be notified of your website changes instantly. | ||
* Extension Version: 1.0.0 | ||
* Extension Author: Sybre Waaijer | ||
* Extension Author URI: https://cyberwire.nl/ | ||
* Extension License: GPLv3 | ||
* Extension Menu Slug: theseoframework-cord | ||
*/ | ||
|
||
defined( 'ABSPATH' ) or die; | ||
|
||
/** | ||
* Cord extension for The SEO Framework | ||
* Copyright (C) 2019 Sybre Waaijer, CyberWire (https://cyberwire.nl/) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as published | ||
* by the Free Software Foundation. | ||
* | ||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* The extension version. | ||
* @since 1.0.0 | ||
* NOTE: The presence does NOT guarantee the extension is loaded!!! | ||
*/ | ||
define( 'TSFEM_E_CORD_VERSION', '1.0.0' ); | ||
|
||
/** | ||
* The extension database version. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_DB_VERSION', '1000' ); | ||
|
||
/** | ||
* The extension file, absolute unix path. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_BASE_FILE', __FILE__ ); | ||
|
||
/** | ||
* The extension map URL. Used for calling browser files. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_DIR_URL', \TSF_Extension_Manager\extension_dir_url( TSFEM_E_CORD_BASE_FILE ) ); | ||
|
||
/** | ||
* The extension file relative to the plugins dir. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_DIR_PATH', \TSF_Extension_Manager\extension_dir_path( TSFEM_E_CORD_BASE_FILE ) ); | ||
|
||
/** | ||
* The plugin class map absolute path. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_PATH_CLASS', TSFEM_E_CORD_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR ); | ||
|
||
/** | ||
* The plugin trait map absolute path. | ||
* @since 1.0.0 | ||
*/ | ||
define( 'TSFEM_E_CORD_PATH_TRAIT', TSFEM_E_CORD_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'traits' . DIRECTORY_SEPARATOR ); | ||
|
||
/** | ||
* Verify integrity and sets up autoloader. | ||
* @since 1.0.0 | ||
*/ | ||
if ( false === \tsf_extension_manager()->_init_early_extension_autoloader( TSFEM_E_CORD_PATH_CLASS, 'Cord', $_instance, $bits ) ) | ||
return; | ||
|
||
// if ( TSFEM_E_CORD_DB_VERSION > \tsf_extension_manager_db_version( 'cord' ) ) { | ||
// require TSFEM_E_CORD_DIR_PATH . 'upgrade.php'; | ||
// } | ||
|
||
\add_action( 'plugins_loaded', __NAMESPACE__ . '\\_cord_init', 11 ); | ||
/** | ||
* Initializes the extension. | ||
* | ||
* @since 1.0.0 | ||
* @staticvar bool $loaded True when loaded. | ||
* @action 'plugins_loaded' | ||
* @priority 11 | ||
* @access private | ||
* | ||
* @return bool True if class is loaded. | ||
*/ | ||
function _cord_init() { | ||
|
||
static $loaded; | ||
|
||
if ( isset( $loaded ) ) | ||
return $loaded; | ||
|
||
if ( \is_admin() ) { | ||
new Admin; | ||
} else { | ||
// new Front; // TODO CRON? | ||
} | ||
|
||
return $loaded = true; | ||
} | ||
|
||
/** | ||
* Returns the active base class. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return string The active class name. | ||
*/ | ||
function get_active_class() { | ||
if ( \is_admin() ) { | ||
return __NAMESPACE__ . '\\Admin'; | ||
} else { | ||
return __NAMESPACE__ . '\\Front'; // TODO | ||
} | ||
} | ||
|
||
/** | ||
* Returns the settings class. | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return string The settings class name. | ||
*/ | ||
function get_layout_class() { | ||
return __NAMESPACE__ . '\\Settings'; | ||
} | ||
|
||
/** | ||
* Requires trait files once. | ||
* | ||
* @since 1.0.0 | ||
* @uses TSFEM_E_CORD_PATH_TRAIT | ||
* @access private | ||
* @staticvar array $loaded | ||
* | ||
* @param string $file Trait file name. | ||
* @return bool True if loaded, false otherwise. | ||
*/ | ||
function _load_trait( $file ) { | ||
|
||
static $loaded = []; | ||
|
||
if ( isset( $loaded[ $file ] ) ) | ||
return $loaded[ $file ]; | ||
|
||
return $loaded[ $file ] = (bool) require TSFEM_E_CORD_PATH_TRAIT . $file . '.trait.php'; | ||
} |
Oops, something went wrong.