Skip to content

Commit

Permalink
PSOURCE Updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed May 24, 2024
1 parent 0d50717 commit cc1bb85
Show file tree
Hide file tree
Showing 131 changed files with 11,002 additions and 23 deletions.
2 changes: 1 addition & 1 deletion admin/class-padma-advanced-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The admin-specific functionality of the plugin.
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
2 changes: 1 addition & 1 deletion admin/partials/padma-advanced-admin-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
4 changes: 2 additions & 2 deletions admin/partials/padma-advanced-require-padma.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Request theme activation
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand All @@ -14,7 +14,7 @@
<div id="message" class="error">
<p>
<?php echo esc_html__( 'Padma Advanced require Padma Unlimited theme to be active . ', 'padma-advanced' ); ?>
<a href="https://www.padmaunlimited.com/" target="_blank"><strong>Padma Unlimited theme</strong></a>
<a href="https://cp-psource.github.io/ps-padma//" target="_blank"><strong>Padma Unlimited theme</strong></a>
</p>
</div>
<?php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Request plugin activation or desactivation
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Request plugin activation or desactivation
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
Empty file added docs/README.md
Empty file.
2 changes: 1 addition & 1 deletion includes/class-padma-advanced-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Register all actions and filters for the plugin
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
2 changes: 1 addition & 1 deletion includes/class-padma-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* A class definition that includes attributes and functions used across both the
* public-facing side of the site and the admin area.
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
2 changes: 1 addition & 1 deletion includes/class-padma-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* A class definition that includes forms and inputs for admin
*
* @link https://www.padmaunlimited.com
* @link https://cp-psource.github.io/ps-padma/
* @since 1.0.0
*
* @package Padma Advanced
Expand Down
2 changes: 1 addition & 1 deletion languages/padma-advanced.pot
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ msgid "Padma Unlimited"
msgstr ""

#. Author URI of the plugin
msgid "https://www.padmaunlimited.com"
msgid "https://cp-psource.github.io/ps-padma/"
msgstr ""

#: admin/class-padma-advanced-admin.php:135
Expand Down
37 changes: 28 additions & 9 deletions padma-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,49 @@
* Padma Advanced
*
* @package Padma Advanced
* @author Padma Unlimited
* @link https://www.padmaunlimited.com
* @author PSOURCE
* @link https://github.com/cp-psource
*
* @wordpress-plugin
* Plugin Name: Padma Advanced
* Plugin URI: https://padmaunlimited.com/
* Plugin URI: https://cp-psource.github.io/ps-padma-advanced/
* Description: Expand the possibilities and simplify the design and development processes of WordPress + Padma Theme based websites.
* Version: 0.0.16
* Version: 0.0.2
* Requires at least: 5.2
* Requires PHP: 7.0
* Author: Padma Unlimited
* Author URI: https://www.padmaunlimited.com
* Author: PSOURCE
* Author URI: https://github.com/cp-psource
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: padma-advanced
* Domain Path: /languages
* WC requires at least: 3.0.0
* WC requires at least: 3.0.0
* WC tested up to: 4.9.1
* @fs_premium_only admin/class-padma-advanced-admin-pro.php, includes/class-padma-advanced-blocks-pro.php, blocks-pro/
*/

namespace Padma_Advanced;

/**
* @@@@@@@@@@@@@@@@@ PS UPDATER 1.3 @@@@@@@@@@@
**/
require 'psource/psource-plugin-update/plugin-update-checker.php';
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

$myUpdateChecker = PucFactory::buildUpdateChecker(
'https://github.com/cp-psource/ps-padma-advanced',
__FILE__,
'ps-padma-advanced'
);

//Set the branch that contains the stable release.
$myUpdateChecker->setBranch('main');

/**
* @@@@@@@@@@@@@@@@@ ENDE PS UPDATER 1.3 @@@@@@@@@@@
**/



/**
* If this file is called directly, abort.
*/
Expand All @@ -37,7 +56,7 @@
/**
* Version.
*/
define( 'PADMA_ADVANCED_VERSION', '0.0.16' );
define( 'PADMA_ADVANCED_VERSION', '0.0.2' );


/**
Expand Down
15 changes: 15 additions & 0 deletions psource/psource-plugin-update/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=tab
tab_width=4

[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
indent_style=space
indent_size=4

[*.svg]
indent_style=space
indent_size=4

1 change: 1 addition & 0 deletions psource/psource-plugin-update/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build export-ignore
40 changes: 40 additions & 0 deletions psource/psource-plugin-update/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# The entire IDEA/PhpStorm directory
.idea/

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
10 changes: 10 additions & 0 deletions psource/psource-plugin-update/Puc/v5/PucFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5;

if ( !class_exists(PucFactory::class, false) ):

class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p3\PucFactory {
}

endif;
86 changes: 86 additions & 0 deletions psource/psource-plugin-update/Puc/v5p3/Autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5p3;

if ( !class_exists(Autoloader::class, false) ):

class Autoloader {
const DEFAULT_NS_PREFIX = 'YahnisElsts\\PluginUpdateChecker\\';

private $prefix;
private $rootDir;
private $libraryDir;

private $staticMap;

public function __construct() {
$this->rootDir = dirname(__FILE__) . '/';

$namespaceWithSlash = __NAMESPACE__ . '\\';
$this->prefix = $namespaceWithSlash;

$this->libraryDir = $this->rootDir . '../..';
if ( !self::isPhar() ) {
$this->libraryDir = realpath($this->libraryDir);
}
$this->libraryDir = $this->libraryDir . '/';

//Usually, dependencies like Parsedown are in the global namespace,
//but if someone adds a custom namespace to the entire library, they
//will be in the same namespace as this class.
$isCustomNamespace = (
substr($namespaceWithSlash, 0, strlen(self::DEFAULT_NS_PREFIX)) !== self::DEFAULT_NS_PREFIX
);
$libraryPrefix = $isCustomNamespace ? $namespaceWithSlash : '';

$this->staticMap = array(
$libraryPrefix . 'PucReadmeParser' => 'vendor/PucReadmeParser.php',
$libraryPrefix . 'Parsedown' => 'vendor/Parsedown.php',
);

//Add the generic, major-version-only factory class to the static map.
$versionSeparatorPos = strrpos(__NAMESPACE__, '\\v');
if ( $versionSeparatorPos !== false ) {
$versionSegment = substr(__NAMESPACE__, $versionSeparatorPos + 1);
$pointPos = strpos($versionSegment, 'p');
if ( ($pointPos !== false) && ($pointPos > 1) ) {
$majorVersionSegment = substr($versionSegment, 0, $pointPos);
$majorVersionNs = __NAMESPACE__ . '\\' . $majorVersionSegment;
$this->staticMap[$majorVersionNs . '\\PucFactory'] =
'Puc/' . $majorVersionSegment . '/Factory.php';
}
}

spl_autoload_register(array($this, 'autoload'));
}

/**
* Determine if this file is running as part of a Phar archive.
*
* @return bool
*/
private static function isPhar() {
//Check if the current file path starts with "phar://".
static $pharProtocol = 'phar://';
return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol);
}

public function autoload($className) {
if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) {
include($this->libraryDir . $this->staticMap[$className]);
return;
}

if ( strpos($className, $this->prefix) === 0 ) {
$path = substr($className, strlen($this->prefix));
$path = str_replace(array('_', '\\'), '/', $path);
$path = $this->rootDir . $path . '.php';

if ( file_exists($path) ) {
include $path;
}
}
}
}

endif;
Loading

0 comments on commit cc1bb85

Please sign in to comment.