Skip to content

Commit cf720a0

Browse files
author
Michael Toppa
committed
work in progress on checking sys reqs at runtime
1 parent b7b00f4 commit cf720a0

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

Admin/ShashinInstall.php

+13-6
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,22 @@ public function run() {
7272
}
7373

7474
public function runtimeUpgrade() {
75-
// check if an activation error was logged
7675
if (strpos($_SERVER['REQUEST_URI'], 'plugins.php')) {
77-
$cantActivateReason = get_option('shashinCantActivateReason');
76+
$status = shashinActivationChecks();
7877

79-
if ($cantActivateReason) {
80-
echo '<div class="error"><p>';
81-
echo $cantActivateReason;
82-
echo '</p></div>' . PHP_EOL;
78+
if (is_string($status)) {
79+
shashinCancelActivation($status);
80+
return null;
8381
}
82+
83+
//$cantActivateReason = get_option('shashinCantActivateReason');
84+
85+
//if ($cantActivateReason) {
86+
//echo '<div class="error"><p>';
87+
//echo $cantActivateReason;
88+
//echo '</p></div>' . PHP_EOL;
89+
// wp_die($cantActivateReason);
90+
//}
8491
}
8592

8693
// update the version number if needed

readme.txt

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ For troubleshooting help, please [post a comment on my latest Shashin post](http
8585

8686
== Changelog ==
8787

88+
= 3.2 =
89+
* Add albums using Google+ URL and other non-RSS URLs
90+
8891
= 3.1.4 =
8992
* Update settings even if plugin is not deactivated/reactivated, as WP no longer runs activation hooks during plugin auto-upgrades
9093
* Bug fix: Fancybox slideshow was not launching in Firefox (just needed to move the setShashinFancyboxCaption function)

start.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ function shashinActivateForNewNetworkSite($blog_id) {
3535
}
3636

3737
function shashinActivate() {
38-
$autoLoaderPath = dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
39-
$status = shashinActivationChecks($autoLoaderPath);
38+
$status = shashinActivationChecks();
4039

4140
if (is_string($status)) {
4241
shashinCancelActivation($status);
4342
return null;
4443
}
4544

46-
require_once($autoLoaderPath);
45+
require_once dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
4746
$toppaAutoLoader = new ToppaAutoLoaderWp('/toppa-plugin-libraries-for-wordpress');
4847
$shashinAutoLoader = new ToppaAutoLoaderWp('/shashin');
4948
$shashin = new ShashinWp($shashinAutoLoader);
@@ -54,11 +53,12 @@ function shashinActivate() {
5453
return null;
5554
}
5655

57-
delete_option('shashinCantActivateReason');
56+
//delete_option('shashinCantActivateReason');
5857
return null;
5958
}
6059

61-
function shashinActivationChecks($autoLoaderPath) {
60+
function shashinActivationChecks() {
61+
$autoLoaderPath = dirname(__FILE__) . '/../toppa-plugin-libraries-for-wordpress/ToppaAutoLoaderWp.php';
6262
$toppaLibsVersion = get_option('toppaLibsVersion');
6363

6464
if (!file_exists($autoLoaderPath) || !$toppaLibsVersion || version_compare($toppaLibsVersion, '1.3.2', '<')) {
@@ -79,7 +79,8 @@ function shashinActivationChecks($autoLoaderPath) {
7979

8080
function shashinCancelActivation($message) {
8181
deactivate_plugins(basename(__FILE__));
82-
update_option('shashinCantActivateReason', $message);
82+
//update_option('shashinCantActivateReason', $message);
83+
wp_die($message);
8384
}
8485

8586
function shashinDeactivateForNetworkSites() {

0 commit comments

Comments
 (0)