Happy New Year?

Happy New Year, or was it?  This scenario involves one parent, and two children.  The other parent was on their way to pick up one of the two children, but was unaware of what was happening at the house.  Here’s the scenario:

New Year’s Eve, the older sister, she has a driver’s license, asked if she could pick up her younger sister from Parent #1’s home and take her to Parent #2’s house for the weekend. She said she missed her sister, and wanted to spend some time with her.  Parent #1 approved, and the older sibling picked up her younger sister the day before New Year’s Eve.

Upon arriving at Parent #2’s house, the older sister dropped her younger sister off, and then promptly left, she did not return that night either.  Parent #2 expressed surprise that the younger sister was there at the house.  Apparently Parent #2 was unaware that she was coming over for the weekend.

By New Year’s Eve the young sister was bored, and wanted to go home, she was sad she had been left there by her sister.  On New Year’s Day the younger sister contacted Parent #1 relating that she wanted to return.  Parent #1 was confused because there was a misunderstanding apparently.  Parent #1 thought the older sister was going to bring the younger sister back after the visit.  Upon Parent #1 texting the older sibling it was determined that she had no intention of bringing her younger sister back.

The younger sister was becoming upset because she wanted to go home and felt stranded by her older sister at Parent #2’s house.  She text Parent #1 multiple times to come get her. Parent #1 was becoming concerned, so Parent #1 made the drive.  During Parent #1’s drive to pick up the younger sister angry text messages were traded between Parent #1 and the older sister.  The older sister didn’t want Parent #1 to pick up the younger sister, but she didn’t want to bring her back either.

As Parent #1 was driving to pick up the younger sister, the older sister made a mad dash to Parent #2’s house to talk to the younger sister before Parent #1 arrived.  Parent #2 was aware there had been arguing between text messages of Parent #1 and the older sister. Parent #2 encouraged the older sister to argue with Parent #1 with statements like, “You’re absolutely right on all points.” “You’re right.” etc.

When the older sister arrived she was upset, she didn’t want the younger sister to leave.  The younger sister, in an attempt to get away from the older sister, went out into the garage to wait for Parent #1.”  The older sister followed her into the garage, at this point she was very upset, yelling and crying, telling the younger sister that Parent #1 was horrible and bad, and that everybody hated Parent #1.  The older sister blocked the door so the younger sister couldn’t get back into the house.  She continued badgering her younger sister, and berating Parent #1 until the younger sister was in tears as well.  After approximately 30 minutes of this, for unknown reasons the older sister moved out-of-the-way, and the younger sister was able to get through the door into the house.  Another resident of the house was coming down the hall to find out what was going on with all the yelling.  Younger sister was thankful for this person showing up and grabbed and hugged them. This person took the younger sister outside, under a protective wing, until Parent #1 arrived, and found them standing together outside.

Parent #2 had been sitting in the front room the entire time and never said a thing, never tried to intervene, did absolutely nothing to help the younger sister.

Was Parent #2 obligated in any way to intervene when the arguing was heard in the garage? When the older sister took the younger sister for the weekend, who would be most likely to return her?  Was the older sister telling Parent #1 a big story, about missing her sister, just to get her younger sister away from Parent #1? Should Parent #1 trust the older sister to take the younger sister again?  Should parent #1 have assumed it would be their responsibility to pick up the younger child after the visit?

 

 

*/ class PayPalDonations { /** Holds the plugin instance */ private static $instance = false; /** Define plugin constants */ const MIN_PHP_VERSION = '5.2.4'; const MIN_WP_VERSION = '3.0'; const OPTION_DB_KEY = 'paypal_donations_options'; const TEXT_DOMAIN = 'paypal-donations'; const FILE = __FILE__; // ------------------------------------------------------------------------- // Define constant data arrays // ------------------------------------------------------------------------- private $donate_buttons = array( 'small' => 'https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif', 'large' => 'https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif', 'cards' => 'https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif' ); private $currency_codes = array( 'AUD' => 'Australian Dollars (A $)', 'BRL' => 'Brazilian Real', 'CAD' => 'Canadian Dollars (C $)', 'CZK' => 'Czech Koruna', 'DKK' => 'Danish Krone', 'EUR' => 'Euros (€)', 'HKD' => 'Hong Kong Dollar ($)', 'HUF' => 'Hungarian Forint', 'ILS' => 'Israeli New Shekel', 'JPY' => 'Yen (¥)', 'MYR' => 'Malaysian Ringgit', 'MXN' => 'Mexican Peso', 'NOK' => 'Norwegian Krone', 'NZD' => 'New Zealand Dollar ($)', 'PHP' => 'Philippine Peso', 'PLN' => 'Polish Zloty', 'GBP' => 'Pounds Sterling (£)', 'RUB' => 'Russian Ruble', 'SGD' => 'Singapore Dollar ($)', 'SEK' => 'Swedish Krona', 'CHF' => 'Swiss Franc', 'TWD' => 'Taiwan New Dollar', 'THB' => 'Thai Baht', 'TRY' => 'Turkish Lira', 'USD' => 'U.S. Dollars ($)', ); private $localized_buttons = array( 'en_AU' => 'Australia - Australian English', 'de_DE/AT' => 'Austria - German', 'nl_NL/BE' => 'Belgium - Dutch', 'fr_XC' => 'Canada - French', 'zh_XC' => 'China - Simplified Chinese', 'fr_FR/FR' => 'France - French', 'de_DE/DE' => 'Germany - German', 'it_IT/IT' => 'Italy - Italian', 'ja_JP/JP' => 'Japan - Japanese', 'es_XC' => 'Mexico - Spanish', 'nl_NL/NL' => 'Netherlands - Dutch', 'pl_PL/PL' => 'Poland - Polish', 'es_ES/ES' => 'Spain - Spanish', 'de_DE/CH' => 'Switzerland - German', 'fr_FR/CH' => 'Switzerland - French', 'en_US' => 'United States - U.S. English' ); private $checkout_languages = array( 'AU' => 'Australia', 'AT' => 'Austria', 'BE' => 'Belgium', 'BR' => 'Brazil', 'CA' => 'Canada', 'CN' => 'China', 'FR' => 'France', 'DE' => 'Germany', 'IT' => 'Italy', 'NL' => 'Netherlands', 'PL' => 'Poland', 'PR' => 'Portugal', 'RU' => 'Russia', 'ES' => 'Spain', 'SE' => 'Sweden', 'CH' => 'Switzerland', 'GB' => 'United Kingdom', 'US' => 'United States', ); /** * Singleton class */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } /** * Constructor. * Initializes the plugin by setting localization, filters, and * administration functions. */ private function __construct() { if (!$this->testHost()) { return; } add_action('init', array($this, 'textDomain')); register_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall')); $admin = new PayPalDonations_Admin(); $admin->setOptions( get_option(self::OPTION_DB_KEY), $this->currency_codes, $this->donate_buttons, $this->localized_buttons, $this->checkout_languages ); add_filter('widget_text', 'do_shortcode'); add_shortcode('paypal-donation', array(&$this,'paypalShortcode')); add_action('wp_head', array($this, 'addCss'), 999); add_action( 'widgets_init', create_function('', 'register_widget("PayPalDonations_Widget");') ); } /** * PSR-0 compliant autoloader to load classes as needed. * * @param string $classname The name of the class * @return null Return early if the class name does not start with the * correct prefix */ public static function autoload($className) { if (__CLASS__ !== mb_substr($className, 0, strlen(__CLASS__))) { return; } $className = ltrim($className, '\\'); $fileName = ''; $namespace = ''; if ($lastNsPos = strrpos($className, '\\')) { $namespace = substr($className, 0, $lastNsPos); $className = substr($className, $lastNsPos + 1); $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace); $fileName .= DIRECTORY_SEPARATOR; } $fileName .= str_replace('_', DIRECTORY_SEPARATOR, 'src_'.$className); $fileName .='.php'; require $fileName; } /** * Loads the plugin text domain for translation */ public function textDomain() { $domain = self::TEXT_DOMAIN; $locale = apply_filters('plugin_locale', get_locale(), $domain); load_textdomain( $domain, WP_LANG_DIR.'/'.$domain.'/'.$domain.'-'.$locale.'.mo' ); load_plugin_textdomain( $domain, false, dirname(plugin_basename(__FILE__)).'/lang/' ); } /** * Fired when the plugin is uninstalled. */ public function uninstall() { delete_option('paypal_donations_options'); delete_option('widget_paypal_donations'); } /** * Adds inline CSS code to the head section of the html pages to center the * PayPal button. */ public function addCss() { $opts = get_option(self::OPTION_DB_KEY); if (isset($opts['center_button']) and $opts['center_button'] == true) { echo ''."\n"; } } /** * Create and register the PayPal shortcode */ public function paypalShortcode($atts) { extract( shortcode_atts( array( 'purpose' => '', 'reference' => '', 'amount' => '', 'return_page' => '', 'button_url' => '', 'validate_ipn' => '', ), $atts ) ); return $this->generateHtml( $purpose, $reference, $amount, $return_page, $button_url, $validate_ipn ); } /** * Generate the PayPal button HTML code */ public function generateHtml( $purpose = null, $reference = null, $amount = null, $return_page = null, $button_url = null, $validate_ipn = '' ) { $pd_options = get_option(self::OPTION_DB_KEY); // Set overrides for purpose and reference if defined $purpose = (!$purpose) ? $pd_options['purpose'] : $purpose; $reference = (!$reference) ? $pd_options['reference'] : $reference; $amount = (!$amount) ? $pd_options['amount'] : $amount; $return_page = (!$return_page) ? $pd_options['return_page'] : $return_page; $button_url = (!$button_url) ? $pd_options['button_url'] : $button_url; $data = array( 'pd_options' => $pd_options, 'return_page' => $return_page, 'purpose' => $purpose, 'reference' => $reference, 'amount' => $amount, 'button_url' => $button_url, 'donate_buttons' => $this->donate_buttons, 'validate_ipn' => $validate_ipn, ); return PayPalDonations_View::render('paypal-button', $data); } // ------------------------------------------------------------------------- // Environment Checks // ------------------------------------------------------------------------- /** * Checks PHP and WordPress versions. */ private function testHost() { // Check if PHP is too old if (version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<')) { // Display notice add_action('admin_notices', array(&$this, 'phpVersionError')); return false; } // Check if WordPress is too old global $wp_version; if (version_compare($wp_version, self::MIN_WP_VERSION, '<')) { add_action('admin_notices', array(&$this, 'wpVersionError')); return false; } return true; } /** * Displays a warning when installed on an old PHP version. */ public function phpVersionError() { echo '

'; printf( 'Error: %3$s requires PHP version %1$s or greater.
'. 'Your installed PHP version: %2$s', self::MIN_PHP_VERSION, PHP_VERSION, $this->getPluginName() ); echo '

'; } /** * Displays a warning when installed in an old Wordpress version. */ public function wpVersionError() { echo '

'; printf( 'Error: %2$s requires WordPress version %1$s or greater.', self::MIN_WP_VERSION, $this->getPluginName() ); echo '

'; } /** * Get the name of this plugin. * * @return string The plugin name. */ private function getPluginName() { $data = get_plugin_data(self::FILE); return $data['Name']; } } add_action('plugins_loaded', array('PayPalDonations', 'getInstance'));

Leave a Reply