immonex/wp-free-plugin-core 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

immonex/wp-free-plugin-core

Composer 安装命令:

composer require immonex/wp-free-plugin-core

包简介

Shared basic functionality for free immonex WordPress plugins

README 文档

README

immonex Open Source Software

This lightweight PHP/JS library provides shared basic functionality for free immonex WordPress plugins, i.a.

  • consistent initialization
  • autoloading of CSS and JS files
  • option handling / shared settings pages
  • geocoding and domains
  • simple templating (incl. Twig 3)
  • special string checking and manipulation
  • color calculations
  • domain and URL handling
  • emails
  • videos

immonex®

immonex is the PropTech umbrella brand of a versatile portfolio of software solutions for the German-speaking real estate industry.

As a part of this, the immonex WP Plugin Suite includes a wide range of WordPress plugins for the implementation of sophisticated real estate agency websites and portals, which can be flexibly combined depending on the specific project requirements.

Installation

Via Composer

$ composer require immonex/wp-free-plugin-core

Basic Usage

In most cases, a boilerplate template will be used to kickstart plugin development based on this library. Anyway, here comes a basic working example...

The example plugin folder:

myimmonex-example-plugin
├── includes
│   └── class-example-plugin.php
├── languages
├── [vendor]
├── autoload.php
├── composer.json
└── myimmonex-example-plugin.php

With the Composer-based installation, the plugin core library gets added to the require section in composer.json:

    "require": {
        "immonex/wp-free-plugin-core": "^2.13.2"
    },

myimmonex-example-plugin.php is the main plugin file in which the central autoloader file is being included and the main plugin object gets instantiated:

require_once __DIR__ . '/autoload.php';

$myimmonex_example_plugin = new My_Plugin( basename( __FILE__, '.php' ) );
$myimmonex_example_plugin->init();

The main plugin class is located in the file includes/class-example-plugin.php. It is derived from the latest core Base class:

class Example_Plugin extends \immonex\WordPressFreePluginCore\V2_13_2\Base {

	const
		PLUGIN_NAME = 'My immonex Plugin',
		PLUGIN_PREFIX = 'myplugin_',
		PUBLIC_PREFIX = 'myplugin-',
		PLUGIN_VERSION = '1.1.0',
		OPTIONS_LINK_MENU_LOCATION = 'settings';

	...

} // class Example_Plugin

That's it!

Folder Based Versioning

The src folder usually contains two "version branch" folders for the latest development (DEV_[0-9]+) and production release (VX_X_X) versions. It may optionally contain multiple production release folders.

src
├── DEV <────┐ Development Branch (DB), NS: immonex\WordPressFreePluginCore\DEV
├── V1_0_0   │ optional PB
├── V1_1_0   │ optional PB
└── V2_13_2 ─┘ Latest Production Branch (PB), NS: immonex\WordPressFreePluginCore\V2_13_2

The folder names are also part of the related PHP namespaces in the included files, e.g. immonex\WordPressFreePluginCore\V1_0_1.

An arbitrary number and an underscore may be added to the folder name and class namespaces of the DEV folder to ensure uniqueness during development, e.g. immonex\WordPressFreePluginCore\DEV12_3.

Public (production) releases of plugins that use this library always refer to the latest production branch.

Background

Multiple immonex plugins that possibly require different versions of the core library can be active in the same WordPress installation. As these plugins are - more or less - independent components, the Composer dependency management does not work here. Ergo: Each plugin must ensure itself that the used core library files exactly match the required version.

The autoloading chain supplied by this lib avoids incompatibilities that can occur, for example, if an incompatible version has already been loaded by another active immonex plugin.

Development

Requirements

Setup

Setting up a simple development environment starts by cloning this repository and installing dependencies:

$ cd ~/projects
$ git clone git@github.com:immonex/wp-free-plugin-core.git immonex-wp-free-plugin-core
$ cd immonex-wp-free-plugin-core
$ npm install
$ composer install

⚠️ PHP_CodeSniffer and the related WP sniffs are not part of the default dependencies and should be installed globally).

Git

PHP compatibility

7.4+ (switch to 8.3+ envisaged for future releases)

Coding Standard

The source code formatting corresponds to the WordPress PHP Coding Standards.

The source files can be checked with PHP_CodeSniffer (if, as recommended, installed globally as described here)):

$ phpcs

To fix violations automatically as far as possible:

$ phpcbf

API Documentation

The API documentation based on the sources can be generated with the following command and is available in the apidoc folder afterwards:

$ npm run apidoc

To view it using a local webserver:

$ npm run apidoc:view

If these docs are not needed anymore, the respective folders can be deleted with this command:

$ npm run apidoc:delete

(The folder apidoc is meant to be used locally, it should not a part of any repository.)

Testing

Locally running unit tests (PHPUnit) for plugins usually requires a temporary WordPress installation (see infos on make.wordpress.org). To use the test install script included in this repository, the file .env containing credentials of a local test database has to be created first (see .env.example).

After that, the temporary testing environment can be installed:

$ npm run test:install

Running tests in the tests folder:

$ npm run test

Translations

The core classes of this library do and should only include a few strings that have to be translated. Translations (PO/MO files) that are distributed as part of this library are provided in the languages subfolders of the version branch directories. These folders also contain a current POT file as base for custom translations that can be updated with the following command.

$ npm run pot

Copies of the the german default translation files (MO/de_DE) for the WP locales de_DE_formal, de_AT, de_CH and ch_CH_informal in all dev and production folders can be created with:

$ npm run copy-mo

(Existing translation files will not be overwritten.)

License

GPLv2 or later

Copyright (C) 2014, 2026 inveris OHG / immonex

This library 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 (at your option) any later version.

This library 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.

immonex/wp-free-plugin-core 适用场景与选型建议

immonex/wp-free-plugin-core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 614 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「plugin」 「wordpress」 「wp」 「real estate」 「openimmo」 「immobilien」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 immonex/wp-free-plugin-core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 immonex/wp-free-plugin-core 我们能提供哪些服务?
定制开发 / 二次开发

基于 immonex/wp-free-plugin-core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 614
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-03-06